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

reactogen

v1.0.3

Published

Generate your react redux module (Duck Structure) by answering a few questions

Downloads

2

Readme

Reactogen

Reactogen is CLI tool to create your redux (duck structured) modules quickly by answering a few prompts. Though the project has been started for multipurpose but currently it supports only creating react redux modules. Demo

How To Install

You can install reactogen globally or locally in your project by running the following command: npm install reactogen -g

How To Use

Once you are done with installing the tool, you just need to run the following command in any directory where you want your module to be generated. reactogen generate Running this command will prompt the following few questions:

What is your Module Name?:

Enter whatever the name of your module you want for e.g. users, createUser, UserRole. It will create the directory with this module name.

Are you using ImmutableJS?:

If you answer it as YES it will add the immutableJS imports in the state and selector files. Also it will make the state immutable.

Are you using Redux Actions (Recommended)?:

If are not aware, Redux Actions is Flux Standard Action utilities for Redux. If you confirm this, all the action creators will return flux standard action and the code will be generated as:

import { createAction } from 'redux-actions';
import * as constants from './constants';

export const fetchUser = createAction(
  constants.FETCH_USER,
  (payload) => payload,
  (payload, meta) => meta
);
Otherwise

It will be a plain action object like below:

export function fetchUsers(payload, meta) {
  return {
    type: constants.FETCH_USERS,
    payload,
    meta,
  };
}
Please enter your constant names in camel or uppercase line by line

This is very important. Once you come to this question, hit the Enter and it will open an editor (notepad etc.). You need to put all your constant names line by line (only one constant should be in a line) and it will create the appropriate constant and action files in the module. Here are the supported constant name formats:

fetch_admin_users
fetchAdminUsers
FETCH_ADMIN_USERS
fetch-admin-users
fetch-Admin-Users
FETCH-ADMIN-USERS

In whatever above format you write your constants, they will be taken care of. All these will be giving a same constant with name FETCH_ADMIN_USERS and the action name fetchAdminUsers.

Please enter your state JSON schema Received

Coming to this question will also open an editor by hitting the Enter key and you need to put your state json schema there. Save it and close it.

Thats all A new module folder will be created with the following files:

  1. constants.js - contains all the constants you put in editor
  2. actions.js - contains all the action creators for given constants
  3. reducer.js - This file will have all the action handlers for given constants
  4. selectors.js - It will contain the root level state selectors using reselect
  5. state.model.js - This is the state holder that contains your state with state modification methods for each action.