0xV3NOMx
Linux ip-172-26-7-228 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64



Your IP : 18.117.254.177


Current Path : /proc/self/root/usr/share/npm/lib/
Upload File :
Current File : //proc/self/root/usr/share/npm/lib/bugs.js

module.exports = bugs

bugs.usage = 'npm bugs [<pkgname>]'

var npm = require('./npm.js')
var log = require('npmlog')
var opener = require('opener')
var fetchPackageMetadata = require('./fetch-package-metadata.js')

bugs.completion = function (opts, cb) {
  // FIXME: there used to be registry completion here, but it stopped making
  // sense somewhere around 50,000 packages on the registry
  cb()
}

function bugs (args, cb) {
  var n = args.length ? args[0] : '.'
  fetchPackageMetadata(n, '.', function (er, d) {
    if (er) return cb(er)

    var url = d.bugs && ((typeof d.bugs === 'string') ? d.bugs : d.bugs.url)
    if (!url) {
      url = 'https://www.npmjs.org/package/' + d.name
    }
    log.silly('bugs', 'url', url)
    opener(url, { command: npm.config.get('browser') }, cb)
  })
}