SailsGulpify.installPackageNpm()

NPM install and --save

Saves npm packages

Usage

Hover over inputs/exits for more info.

var SailsGulpify = require('machinepack-sailsgulpify');


// NPM install and --save

SailsGulpify.installPackageNpm({

name: 'express',

version: '~1.0.0',

dir: '/Users/mikermcneil/dogfood-promo-site',

save: true,

saveDev: true,

prefix: './path-to-project',

loglevel: 'warn',

}).exec({

// An unexpected error occurred.

error: function (err) {

 

},

// Provided semver range is invalid. See https://docs.npmjs.com/misc/semver for more information.

invalidSemVer: function () {

 

},

// OK.

success: function () {

 

},

});

Inputs

name required

The name of the NPM package to install.

'express'
version

A version string (or semver range) of the NPM package to install.

'~1.0.0'
dir

The local path where the package should be installed as a dependency.

'/Users/mikermcneil/dogfood-promo-site'
save

If set, the installed package will be saved to the package.json file as a dependency.

true
saveDev

If set, the installed package will be saved to the package.json file as a development-only dependency.

true
prefix

An optional path prefix which affects the root path in which this NPM package gets installed.

'./path-to-project'
loglevel

If set, NPM will write logs to the console at the specified log level.

'warn'

Exits

error

An unexpected error occurred.

invalidSemVer

Provided semver range is invalid. See https://docs.npmjs.com/misc/semver for more information.

success

OK.