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.191.223.30


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

var npm = require('./npm.js')

module.exports = ping

ping.usage = 'npm ping\nping registry'

function ping (args, silent, cb) {
  if (typeof cb !== 'function') {
    cb = silent
    silent = false
  }
  var registry = npm.config.get('registry')
  if (!registry) return cb(new Error('no default registry set'))
  var auth = npm.config.getCredentialsByURI(registry)

  npm.registry.ping(registry, {auth: auth}, function (er, pong) {
    if (!silent) console.log(JSON.stringify(pong))
    cb(er, er ? null : pong)
  })
}