lib/installer.js
function npmInstall(packages, callback) {
  callback = utils.defineCallback(callback);
  if (_.isString(packages)) {
    packages = [ packages ];
  }
  return npm.load({
    loglevel: "silent",
    prefix: tmpDir,
  }, function(loadErr) {
    if (loadErr) {
      return callback(new errors.NpmLoadError(loadErr));
    }
    npm.commands.install(packages, function(installErr) {
      if (installErr) {
        return callback(new errors.NpmInstallError(installErr));
      }
      ncp(tmpDir + "/node_modules/", pluginsDir, function(copyError) {
        if (copyError) {
          return callback(new errors.PluginsMoveFromTempError(copyError));
        }
        return callback(null);
      }); // ncp
    }); // npm.commands.install
  }); // npm.load
}
function npmInstall(packages, callback) {
  callback = utils.defineCallback(callback);
  if (_.isString(packages)) {
    packages = [ packages ];
  }
  return npm.load({
    loglevel: "silent",
    prefix: tmpDir,
  }, function(loadErr) {
    if (loadErr) {
      return callback(new errors.NpmLoadError(loadErr));
    }
    npm.commands.install(packages, function(installErr) {
      if (installErr) {
        return callback(new errors.NpmInstallError(installErr));
      }
      ncp(tmpDir + "/node_modules/", pluginsDir, function(copyError) {
        if (copyError) {
          return callback(new errors.PluginsMoveFromTempError(copyError));
        }
        return callback(null);
      }); // ncp
    }); // npm.commands.install
  }); // npm.load
}
function npmInstall ( packages , callback ) { callback = utils . defineCallback ( callback ) ; if ( _ . isString ( packages ) ) { packages = [ packages ] ; } return npm . load ( { loglevel : "silent" , prefix : tmpDir , } , function ( loadErr ) { if ( loadErr ) { return callback ( new errors . NpmLoadError ( loadErr ) ) ; } npm . commands . install ( packages , function ( installErr ) { if ( installErr ) { return callback ( new errors . NpmInstallError ( installErr ) ) ; } ncp ( tmpDir + "/node_modules/" , pluginsDir , function ( copyError ) { if ( copyError ) { return callback ( new errors . PluginsMoveFromTempError ( copyError ) ) ; } return callback ( null ) ; } ) ; // ncp } ) ; // npm.commands.install } ) ; // npm.load }
Install plugins using NPM

@param  {String|String[]} packages - name of packages
@param  {Function} [callback]
Install plugins using NPM