Plop-gen
A tool based on plop.js that gives you a simple way to generate your react, angular, vue and stencil components. You can create also structures and patterns in our code (routes, controllers, components, helpers, etc).
Installation
Add plop-gen
to your project
$ npm install --save-dev plop-gen
Install plop-gen
globally
$ npm install -g plop-gen
CLI Usage
Once plop-gen
is installed, you are ready to run pgen
from the terminal.
Usage:
$ pgen // Select from a list of available generators
$ pgen <name> // Run a generator registered under that name
Options:
$ pgen -h, --help // Show the help
$ pgen -i, --init // Create a basic plopfile.js
$ pgen -p, --plopfile // Path to the plopfile
$ pgen -v, --version // Display current version
$ pgen --cwd // Directory from which relative paths are calculated against
Examples:
$ pgen
$ pgen create-component --cwd /path/where/you/will/create/your/component
$ pgen rename-component
Create a component
- You need just to run
pgen
from the terminal
$ pgen
- Then, choose the
create-component
generator
Or you can run directly this command:
$ pgen create-component
-
Then, choose the framework you like to use from the list:
- react
- angular
- vue
- stencil
-
Enter the name of your component
-
Select the where you want to create the component. Enjoy :) your component was created
Rename component
If you need to rename a component:
You need just to run pgen
from the terminal
$ pgen
Then, choose the rename-component
generator
Or you can run directly this command:
$ pgen rename-component
Then follow the steps.
License
Licensed under MIT.