1.0.7 • Published 3 years ago

generate-react-redux-cli v1.0.7

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

Generate-React-Redux-Cli

A simple CLI to generate react components and create redux store, actions, and reducers

Install

npm i -g generate-react-redux-cli

Usage

Note: create reducer before creating store.

FlagsDescriptionValue Type
cto create component
rto create a reducer
sto create a redux store
ato create an action
-pto specify a path
-ttype of a componentfunctional/class

To create a component

generate-react-redux c Example

Example of the component files structure

|-- /src
    |-- /components
        |-- /Example.jsx

To create a reducer

generate-react-redux e ExampleReducer

Example of the component files structure

|-- /src
    |-- /reducers
        |-- /ExampleReducer.js
        |-- /rootReducer.js

To create a store

generate-react-redux s

Example of the component files structure

|-- /src
    |-- /store
        |-- /index.js

To create an action

generate-react-redux a ExampleAction

Example of the component files structure

|-- /src
    |-- /actions
        |-- /ExampleAction.js

Options

path e.g src/components

generate-react-redux c Example -p src/pages/components

Example of the component files structure

|-- /src
    |-- /pages
        |-- /components
            |-- /Example.jsx
generate-react-redux c Example -p src/pages/components

Example of the component

generate-react-redux c Example -p src/pages/components -t class

License

MIT