mirror of
https://github.com/nodejs/node.git
synced 2025-05-21 17:44:15 +00:00

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>
20 lines
438 B
JavaScript
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
|