gen-component
v0.4.5
Published
Simple component generator for React js.
Downloads
9
Readme
Component generator
Simple component generator for React js.
Example:
$ gen-component -c=name
|-- components
|-- name
|-- Name.jsx
|-- style.css
Links
Install
Install with npm
$ npm i gen-component -g
Flags and Aliases
File name
name for component, !required
--component=name as -c=name
Component extension
extension name for component, by default equals
jsx
3 variants: "jsx", "tsx", "coffee"
--ext=extname as -e=extname
File is style
extension name
for style, by default equalscss
--style-type=extname as -st=extname
or
null
for remove file
--style-type=null as -st=null
Index file:
create index file with export, by default not exist
--index as -i
Root dir where finds folder "components"
--root=src as -r=src
Subfolders
$ gen-component -c=folder/component
|-- components
|-- folder
|-- component
|-- Component.jsx
|-- style.css
Npm script
Example:
File: package.json
"scripts": {
"create": "gen-component -i -e=tsx -st=scss -r=src"
}
$ npm run create -- -c=name
|-- src
|-- components
|-- name
|-- Name.tsx
|-- style.scss
|-- index.ts