generate-cli-react

1.1.0 • Public • Published

Generate React CLI

This tool provides fast creating React components and gets rid of copying, pasting and renaming files.

Installation

  npm install generate-cli-react --save-dev

Usage

This command create a folder with your component within default directory.

  npx generate-react component Box

You can also generate a few components at once.

  npx generate-react component Box Card Button

Example of the component files structure by default:

|-- /src
    |-- /components
        |-- /Box
            |-- Box.js
            |-- index.js

Options

You can also overwrite default options.

  npx generate-react component Box --withStyle --usePreprocessor scss

Example of the component files structure with options above:

|-- /src
    |-- /components
        |-- /Box
            |-- Box.js
            |-- Box.scss
            |-- index.js
Options Description Value Type Default Value
--path The path where you want the component to be generated. String ./src/components
--withStyle Creates a stylesheet file with this component. Boolean false
--useTypescript Creates the typescript component. Boolean false
--usePreprocessor Creates a stylesheet file used a preprocessor such as scss with this component. String ""
--useTest Creates test file with library enzyme or testingLibrary with this component. String ""

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.1.011latest

Version History

VersionDownloads (Last 7 Days)Published
1.1.011
1.0.30
1.0.20
1.0.00

Package Sidebar

Install

npm i generate-cli-react

Weekly Downloads

11

Version

1.1.0

License

ISC

Unpacked Size

22.5 kB

Total Files

39

Last publish

Collaborators

  • dimaiv