npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

build-react-npm

v0.3.4

Published

Create your react npm library and publish it in no time

Downloads

30

Readme

📦 build-react-npm

CLI for creating reusable, modern React libraries using Webpack and create-react-app.

Intro

Features 🚀

  • A modern and easy to use CLI
  • Rapid development of the component
  • Generates modern JS feature files
  • create-react-app for example usage and local dev
  • Webpack for bundling
  • Babel for transpiling
  • Optional support for TypeScript
  • Sourcemap creation
  • Publish github pages with one command
  • Easy to build and test your component with the example template

How is it different from the other library CLI?

  • It is using latest version of webpack. Currently, other CLI's are using rollup.
  • Development is fast here because we are not directly consuming the component. First we are building it peacefully, and once it is ready then we do npm pack to test in our local environment

Install globally

npm install -g build-react-npm

or

npx build-react-npm

Development

build-react-npm

Once you run the CLI, you will be asked to answer few questions. Complete the steps and you should have a react project with an example component.

If you are using npm

npm run dev

else

yarn dev

You will have a example component running in the browser. You can start developing your component here by adding some Javscript and CSS.

Test

Looks like you have build your awesome react component. Now, we need to test it as an individual component by importing it. To do this first we need to build our component.

To build the component run

yarn build

or

npm run build

This will build the file and also pack you npm package in the format of tgz. You can see a new file has been created with the name of your package at the root level. Something like [name-of-package-version-number].tgz This file will be used in our example dir where we will be testing.

Go to the example directory and check the package.json, you will see your package name in the dependency. You need to change it as per your package name or just rename whatever it is in the [name-of-package-version-number].tgz filename.

npm install

This will install your package and you can test it in in your local project before publishing.

Publish

Once you have tested your component, you can go the root directory and run

npm publish

If you want to create the demo page as well using the git hub page then you can style your example directory and run

npm run deploy

Congratlations 🎉, you have published your package

Libraries bootstrapped from this CLI - build-react-npm

License

MIT © Ankit Kumar

Support my OSS work by following me on twitter