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

set.js « lib « npm « deps - github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 74a002cd638be2fa454634d1489587eff0f6ef8a (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
27
28
29
const BaseCommand = require('./base-command.js')

class Set extends BaseCommand {
  static get description () {
    return 'Set a value in the npm configuration'
  }

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

  /* istanbul ignore next - see test/lib/load-all-commands.js */
  static get usage () {
    return ['<key>=<value> [<key>=<value> ...] (See `npm config`)']
  }

  /* istanbul ignore next - see test/lib/load-all-commands.js */
  async completion (opts) {
    return this.npm.commands.config.completion(opts)
  }

  exec (args, cb) {
    if (!args.length)
      return cb(this.usage)
    this.npm.commands.config(['set'].concat(args), cb)
  }
}
module.exports = Set