Welcome to mirror list, hosted at ThFree Co, Russian Federation.

lifecycle-cmd.js « utils « lib - github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 8be9b5a12f9a35b19ec1155b693eb9d33a49804a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// 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