SILENT KILLERPanel

Current Path: > > usr > lib > node_modules > npm > > node_modules > node-gyp > > lib


Operation   : Linux host59.registrar-servers.com 4.18.0-513.18.1.lve.2.el8.x86_64 #1 SMP Sat Mar 30 15:36:11 UTC 2024 x86_64
Software     : Apache
Server IP    : 198.54.126.42 | Your IP: 216.73.216.8
Domains      : 1034 Domain(s)
Permission   : [ 0755 ]

Files and Folders in: //usr/lib/node_modules/npm//node_modules/node-gyp//lib

NameTypeSizeLast ModifiedActions
Find-VisualStudio.cs File 7931 bytes March 10 2021 14:36:38.
build.js File 5288 bytes March 10 2021 14:36:38.
clean.js File 355 bytes March 10 2021 14:36:38.
configure.js File 12332 bytes March 10 2021 14:36:38.
find-node-directory.js File 2373 bytes March 10 2021 14:36:38.
find-python.js File 11145 bytes March 10 2021 14:36:38.
find-visualstudio.js File 13859 bytes March 10 2021 14:36:38.
install.js File 14348 bytes March 10 2021 14:36:38.
list.js File 641 bytes March 10 2021 14:36:38.
node-gyp.js File 4683 bytes March 10 2021 14:36:38.
process-release.js File 5787 bytes March 10 2021 14:36:38.
proxy.js File 2630 bytes March 10 2021 14:36:38.
rebuild.js File 314 bytes March 10 2021 14:36:38.
remove.js File 1308 bytes March 10 2021 14:36:38.
util.js File 1914 bytes March 10 2021 14:36:38.

Reading File: //usr/lib/node_modules/npm//node_modules/node-gyp//lib/util.js

'use strict'

const log = require('npmlog')
const execFile = require('child_process').execFile
const path = require('path')

function logWithPrefix (log, prefix) {
  function setPrefix (logFunction) {
    return (...args) => logFunction.apply(null, [ prefix, ...args ]) // eslint-disable-line
  }
  return {
    silly: setPrefix(log.silly),
    verbose: setPrefix(log.verbose),
    info: setPrefix(log.info),
    warn: setPrefix(log.warn),
    error: setPrefix(log.error)
  }
}

function regGetValue (key, value, addOpts, cb) {
  const outReValue = value.replace(/\W/g, '.')
  const outRe = new RegExp(`^\\s+${outReValue}\\s+REG_\\w+\\s+(\\S.*)$`, 'im')
  const reg = path.join(process.env.SystemRoot, 'System32', 'reg.exe')
  const regArgs = ['query', key, '/v', value].concat(addOpts)

  log.silly('reg', 'running', reg, regArgs)
  const child = execFile(reg, regArgs, { encoding: 'utf8' },
    function (err, stdout, stderr) {
      log.silly('reg', 'reg.exe stdout = %j', stdout)
      if (err || stderr.trim() !== '') {
        log.silly('reg', 'reg.exe err = %j', err && (err.stack || err))
        log.silly('reg', 'reg.exe stderr = %j', stderr)
        return cb(err, stderr)
      }

      const result = outRe.exec(stdout)
      if (!result) {
        log.silly('reg', 'error parsing stdout')
        return cb(new Error('Could not parse output of reg.exe'))
      }
      log.silly('reg', 'found: %j', result[1])
      cb(null, result[1])
    })
  child.stdin.end()
}

function regSearchKeys (keys, value, addOpts, cb) {
  var i = 0
  const search = () => {
    log.silly('reg-search', 'looking for %j in %j', value, keys[i])
    regGetValue(keys[i], value, addOpts, (err, res) => {
      ++i
      if (err && i < keys.length) { return search() }
      cb(err, res)
    })
  }
  search()
}

module.exports = {
  logWithPrefix: logWithPrefix,
  regGetValue: regGetValue,
  regSearchKeys: regSearchKeys
}

SILENT KILLER Tool