0.0.2 • Published 3 years ago

plop-pack-npm-install-package v0.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

Plop Pack Npm Install

npm

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.

0.0.2

3 years ago

0.0.1

3 years ago