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

root.js « lib - github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: d24a2e20a99de643078be06e1a3a265198e12a62 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
const BaseCommand = require('./base-command.js')
class Root extends BaseCommand {
  /* istanbul ignore next - see test/lib/load-all-commands.js */
  static get description () {
    return 'Display npm root'
  }

  /* istanbul ignore next - see test/lib/load-all-commands.js */
  static get name () {
    return 'root'
  }

  /* istanbul ignore next - see test/lib/load-all-commands.js */
  static get usage () {
    return ['[-g]']
  }

  exec (args, cb) {
    this.root(args).then(() => cb()).catch(cb)
  }

  async root () {
    this.npm.output(this.npm.dir)
  }
}
module.exports = Root