get.js 737 B

12345678910111213141516171819202122232425262728
  1. const BaseCommand = require('./base-command.js')
  2. class Get extends BaseCommand {
  3. /* istanbul ignore next - see test/lib/load-all-commands.js */
  4. static get description () {
  5. return 'Get a value from the npm configuration'
  6. }
  7. /* istanbul ignore next - see test/lib/load-all-commands.js */
  8. static get name () {
  9. return 'get'
  10. }
  11. /* istanbul ignore next - see test/lib/load-all-commands.js */
  12. static get usage () {
  13. return ['[<key> ...] (See `npm config`)']
  14. }
  15. /* istanbul ignore next - see test/lib/load-all-commands.js */
  16. async completion (opts) {
  17. return this.npm.commands.config.completion(opts)
  18. }
  19. exec (args, cb) {
  20. this.npm.commands.config(['get'].concat(args), cb)
  21. }
  22. }
  23. module.exports = Get