get.js 538 B

123456789101112131415161718192021
  1. const Npm = require('../npm.js')
  2. const BaseCommand = require('../base-cmd.js')
  3. class Get extends BaseCommand {
  4. static description = 'Get a value from the npm configuration'
  5. static name = 'get'
  6. static usage = ['[<key> ...] (See `npm config`)']
  7. static params = ['long']
  8. static ignoreImplicitWorkspace = false
  9. static async completion (opts) {
  10. const Config = Npm.cmd('config')
  11. return Config.completion(opts)
  12. }
  13. async exec (args) {
  14. return this.npm.exec('config', ['get'].concat(args))
  15. }
  16. }
  17. module.exports = Get