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 🙏

© 2026 – Pkg Stats / Ryan Hefner

react-scaffold-generator

v0.1.2

Published

A set of generators for an opinionated folder structure, React components and Redux entities.

Readme

React Scaffold Generator

A command-line utility to generate scaffolds for React components and product areas incl. routers, containers, Redux reducers and actions etc.

Disclaimer: The structure generated by the scaffolder is very opinionated and is currently used for frontends at TwentyThree. Note that it might be too specific or unsuitable for your needs / frontend setup. Furthermore it requires a certain Webpack/Babel setup.

Install

Currently you can install it as a beta release using:

npm install -g react-scaffold-generator@beta

This will install the module globally.

Run

Run a task with:

react-scaffold-generator <taskName>

For getting help run:

react-scaffold-generator --help

or

react-scaffold-generator <taskName> --help

Currently two types of tasks are supported:

Task "area"

Running it in the main folder of your module will generate a series of folders based on the URL you provide. For example for providing area/subarea it will generate the following structure:

app/Area/Subarea
├── actions.js - actions 
├── components - subfolder for components, see below
├── index.js - exports a function that registers the reducer and routes
├── reducer.js - reducer function
└── routes.js - routes

Based on provided answers it will also generate a component in the components folder (see Task "component" below)

Task "component"

This task will also ask you for an area URL unless it is run with a --here (or -e option). Running with that option is supported from an area folder or the components subfolder of the area.

For a given test component name it will generate a subfolder within the components folder with the following structure:

components/TestComponent
├── TestComponent.jsx  - the main React component file
├── TestComponent.scss - SASS stylesheets scoped down to the component class
└── TestComponent.test.js - sample tests that fail on default and provoke adjustment

Integrate into existing setup

First level area

If you chose a first-level URL like /areaname during the task run you need to import the register function from index.js in the area root. The function registers routes and the reducer and should be called with the following signature:

registerArea(routerNamespace, childRoutes, reducers);
  • routerNamespace - a string for the path of your area, usually the same as the last segment of the URL
  • childRoutes - an Object describing routes passed into React Router, note that it will be modified by the method above
  • reducers - reducer will be exported here and can be passed when your Redux store is initialized (for example through Redux combineReducers function)

Deeper areas

The index.js file is unnecessary in this case and can be deleted.

Reducer

First of all you need to decide whether the area should have its own reducer or use the reducer of the area above. In the former case you will have to import the reducer file in the index.js register function of the area above and assign the reducer to a new key of your reducers object. In the latter case you can delete the generated reducer.js file.

Routing

In the routes.js router setup of the area above you can import the generated routes.js file and add it to the childRoots array.