0.1.15 • Published 6 years ago

create-component-files v0.1.15

Weekly downloads
2
License
ISC
Repository
github
Last release
6 years ago

create-component-files Build Status

Simple React component creator, just for fun : )

It creates a folder with a bunch of files in a desired location:

MyComponent
  |_ index.js
  |_ MyComponent.scss
  |_ README.md

With flag type=container Scss-file will not be created:

MyComponent
  |_ index.js
  |_ README.md

Install

npm i create-component-files --save

Usage from package

$(npm bin)/create-component-files --path=./src/components/ --name=MyComponent

or without prefix --name:

$(npm bin)/create-component-files --path=./src/components/ MyComponent

Usage from npm scripts

If you need to have fixed components folder path:

"scripts": {
  "create": "create-component-files --path=./src/components/"
}

It allows to set --path once and then just pass component name like this:

npm run create MyComponent

Without fixed path:

"scripts": {
  "create": "create-component-files"
}

This command will create component in current folder:

npm run create MyComponent

In you need to pass a path:

npm run create -- --path=PATH-TO-COMPONENTS MyComponent;

Options

--name — name for component. --name=MyComponent and MyComponent are equal.

--path — path to components folder. Optional.

--type — type of component. Optional. Use type=container to get container component without styles. Js-file will contain mapStateToProps, mapDispatchProps and connect

My usage example

"scripts": {
  "create": "create-component-files",
  "component": "create-component-files --path=./src/components/",
  "container": "create-component-files --path=./src/containers/ --type=container"
}

Command npm run create MyComponent will create MyComponent in current folder. Folder will contain js, styles & docs.

npm run component MyComponent will create MyComponent in folder with your components. Folder will contain js, styles & docs.

npm run container MyComponent will create MyComponent in folder with your containers. Folder will contain js & docs (no styles).

0.1.15

6 years ago

0.1.14

6 years ago

0.1.13

6 years ago

0.1.12

6 years ago

0.1.11

6 years ago

0.1.10

6 years ago

0.1.9

6 years ago

0.1.8

6 years ago

0.1.7

6 years ago

0.1.6

6 years ago

0.1.5

6 years ago

0.1.4

6 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago