node/deps/npm/lib/utils/lifecycle-cmd.js
Ruy Adorno f3d3769f9f
deps: upgrade npm to 7.6.1
PR-URL: https://github.com/nodejs/node/pull/37606
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2021-03-05 15:32:56 -05:00

20 lines
438 B
JavaScript

// The implementation of commands that are just "run a script"
// restart, start, stop, test
const usageUtil = require('./usage.js')
class LifecycleCmd {
constructor (npm, stage) {
this.npm = npm
this.stage = stage
}
get usage () {
return usageUtil(this.stage, `npm ${this.stage} [-- <args>]`)
}
exec (args, cb) {
this.npm.commands['run-script']([this.stage, ...args], cb)
}
}
module.exports = LifecycleCmd