redux-scaffolder

Generate three redux files by CLI: constants.js, actions.js, reducers.js

Usage no npm install needed!

<script type="module">
  import reduxScaffolder from 'https://cdn.skypack.dev/redux-scaffolder';
</script>

README

Generate three redux files from CLI: "constants.js, actions.js, reducers.js"

npm npm NPM

If you want to say thank you.

Install

npm install -g redux-scaffolder

To generate constants, actions and reducers you can run base (alias b) command. Next CLI will ask you to write your constants.

redux base 

# alias 
redux b

Result example

Note: yours input consts will be transformed to uppercase

Options for base command:

  • -r (--read) to read consts from "constants.js" file
redux b -r

Otherwise you can generate "constants.js" with consts command (alias c):

redux c

Options for consts command:

  • -p (--path) to specify path/ACTION_TYPE

Then you can generate actions and reducers. Tool will read constants from "constants.js" file.

To create actions.js use actions (alias a) command:

redux a

To generate reducers.js there is reducer [name] (alias r) command:

redux r REDUCER_NAME

# or leave name blank
redux r