0.0.2 • Published 3 years ago
plop-pack-npm-install-package v0.0.2
Plop Pack Npm Install
A PlopJS action to install a package with NPM.
Installation
npm i plop-pack-npm-install-package
Usage
module.exports = function (plop) {
// Loads the npmInstall action type
plop.load('plop-pack-npm-install-package');
plop.setGenerator('generate', {
prompts: [
// ...
],
actions: (data) => {
const actions = [];
actions.push({
type: 'npmInstallModule',
name: 'your-module', // your module name
version: '0.0.1', // expected version [default: 'latest']
path: '.', // installation path [default: '.']
forceInstall: false, // force install if set to true (even if already installed, it will do a reinstall) [default: false]
npmLoad: {
// npm.load(options, callback): this is the "options" given to npm.load()
loglevel: 'silent', // [default: {loglevel: 'silent'}]
},
});
},
});
};
See the npmi docs for more information about the configuration options.