A PlopJS action to install packages with NPM.
npm i plop-pack-npm-install-packages
module.exports = (plop) => {
// Loads the npmInstall action type
plop.load('plop-pack-npm-install-packages');
plop.setGenerator('generator-name', {
prompts: [
// ...
],
actions: [
{
type: 'npmInstallPackages',
// Can be a string or an array
install: ['react', 'lodash@4.17.14'],
},
],
});
};
For a Plop action that runs npm install
for all the dependencies in a package.json
, check out plop-pack-npm-install.