plop-actions
v0.1.0
Published
Useful to have actions for [PlopJS](https://github.com/plopjs/plop). There are currently two actions as part of this package:
Downloads
4
Readme
Plop Actions
Useful to have actions for PlopJS. There are currently two actions as part of this package:
npmInstall
gitInit
npmInstall
This action runs npm install
on the respective path passed to it.
Example
const {npmInstall} = require('plop-actions');
module.exports = function(plop) {
plop.setActionType('npmInstall', gitInit);
plop.setGenerator('generate', {
prompts: [
// ...
],
actions: function(data) {
const actions = [];
actions.push({
type: 'npmInstall',
path: `${process.cwd()}/project-name/`,
// By default is false, but if "true" will log the output of commands
verbose: true
})
}
})
}
gitInit
This action runs the following commands on the respective path passed to it:
git init
git add -A
git commit -m "Initial commit"
Example
const {gitInit} = require('plop-actions');
module.exports = function(plop) {
plop.setActionType('gitInit', gitInit);
plop.setGenerator('generate', {
prompts: [
// ...
],
actions: function(data) {
const actions = [];
actions.push({
type: 'gitInit',
path: `${process.cwd()}/project-name/`,
// By default is false, but if "true" will log the output of commands
verbose: true
})
}
})
}