403Webshell
Server IP : 66.29.132.122  /  Your IP : 3.144.100.237
Web Server : LiteSpeed
System : Linux business142.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64
User : admazpex ( 531)
PHP Version : 7.2.34
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /proc/self/root/opt/alt/alt-nodejs8/root/lib/node_modules/npm/lib/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /proc/self/root/opt/alt/alt-nodejs8/root/lib/node_modules/npm/lib/ping.js
'use strict'

const npmConfig = require('./config/figgy-config.js')
const fetch = require('libnpm/fetch')
const figgyPudding = require('figgy-pudding')
const log = require('npmlog')
const npm = require('./npm.js')
const output = require('./utils/output.js')

const PingConfig = figgyPudding({
  json: {},
  registry: {}
})

module.exports = ping

ping.usage = 'npm ping\nping registry'

function ping (args, silent, cb) {
  if (typeof cb !== 'function') {
    cb = silent
    silent = false
  }

  const opts = PingConfig(npmConfig())
  const registry = opts.registry
  log.notice('PING', registry)
  const start = Date.now()
  return fetch('/-/ping?write=true', opts).then(
    res => res.json().catch(() => ({}))
  ).then(details => {
    if (silent) {
    } else {
      const time = Date.now() - start
      log.notice('PONG', `${time / 1000}ms`)
      if (npm.config.get('json')) {
        output(JSON.stringify({
          registry,
          time,
          details
        }, null, 2))
      } else if (Object.keys(details).length) {
        log.notice('PONG', `${JSON.stringify(details, null, 2)}`)
      }
    }
  }).nodeify(cb)
}

Youez - 2016 - github.com/yon3zu
LinuXploit