node/deps/npm/lib/utils/lifecycle-cmd.js
Myles Borins ace4fe566f
deps: update npm to 5.5.1
Closes: https://github.com/nodejs/node/pull/16280

PR-URL: https://github.com/nodejs/node/pull/16509
Fixes: https://github.com/nodejs/node/issues/14161
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
2017-10-29 21:32:15 -04:00

19 lines
496 B
JavaScript

exports = module.exports = cmd
var npm = require('../npm.js')
var usage = require('./usage.js')
function cmd (stage) {
function CMD (args, cb) {
npm.commands['run-script']([stage].concat(args), cb)
}
CMD.usage = usage(stage, 'npm ' + stage + ' [-- <args>]')
var installedShallow = require('./completion/installed-shallow.js')
CMD.completion = function (opts, cb) {
installedShallow(opts, function (d) {
return d.scripts && d.scripts[stage]
}, cb)
}
return CMD
}