SILENT KILLERPanel

Current Path: > > lib > node_modules > npm > lib


Operation   : Linux premium131.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
Software     : Apache
Server IP    : 162.0.232.56 | Your IP: 216.73.216.111
Domains      : 1034 Domain(s)
Permission   : [ 0755 ]

Files and Folders in: //lib/node_modules/npm/lib

NameTypeSizeLast ModifiedActions
auth Directory - -
config Directory - -
doctor Directory - -
install Directory - -
search Directory - -
utils Directory - -
access.js File 5672 bytes March 10 2021 14:36:36.
adduser.js File 1337 bytes March 10 2021 14:36:36.
audit.js File 10811 bytes March 10 2021 14:36:36.
bin.js File 515 bytes March 10 2021 14:36:36.
bugs.js File 864 bytes March 10 2021 14:36:35.
build.js File 4545 bytes March 10 2021 14:36:36.
cache.js File 4773 bytes March 10 2021 14:36:36.
ci.js File 1341 bytes March 10 2021 14:36:36.
completion.js File 7278 bytes March 10 2021 14:36:36.
config.js File 7612 bytes March 10 2021 14:36:36.
dedupe.js File 4999 bytes March 10 2021 14:36:35.
deprecate.js File 2157 bytes March 10 2021 14:36:35.
dist-tag.js File 4204 bytes March 10 2021 14:36:36.
docs.js File 1063 bytes March 10 2021 14:36:36.
doctor.js File 4075 bytes March 10 2021 14:36:35.
edit.js File 1407 bytes March 10 2021 14:36:36.
explore.js File 1709 bytes March 10 2021 14:36:36.
fetch-package-metadata.js File 4064 bytes March 10 2021 14:36:36.
fetch-package-metadata.md File 1811 bytes March 10 2021 14:36:36.
fund.js File 5026 bytes March 10 2021 14:36:36.
get.js File 235 bytes March 10 2021 14:36:36.
help-search.js File 5777 bytes March 10 2021 14:36:36.
help.js File 6507 bytes March 10 2021 14:36:36.
hook.js File 4727 bytes March 10 2021 14:36:35.
init.js File 2805 bytes March 10 2021 14:36:36.
install-ci-test.js File 486 bytes March 10 2021 14:36:36.
install-test.js File 507 bytes March 10 2021 14:36:36.
install.js File 37345 bytes March 10 2021 14:36:36.
link.js File 5739 bytes March 10 2021 14:36:36.
logout.js File 1289 bytes March 10 2021 14:36:36.
ls.js File 16480 bytes March 10 2021 14:36:36.
npm.js File 14719 bytes March 10 2021 14:36:36.
org.js File 4276 bytes March 10 2021 14:36:36.
outdated.js File 12572 bytes March 10 2021 14:36:35.
owner.js File 6754 bytes March 10 2021 14:36:36.
pack.js File 12068 bytes March 10 2021 14:36:36.
ping.js File 1141 bytes March 10 2021 14:36:36.
prefix.js File 330 bytes March 10 2021 14:36:36.
profile.js File 11401 bytes March 10 2021 14:36:36.
prune.js File 2281 bytes March 10 2021 14:36:36.
publish.js File 5264 bytes March 10 2021 14:36:36.
rebuild.js File 2143 bytes March 10 2021 14:36:36.
repo.js File 1471 bytes March 10 2021 14:36:35.
restart.js File 64 bytes March 10 2021 14:36:36.
root.js File 320 bytes March 10 2021 14:36:35.
run-script.js File 5540 bytes March 10 2021 14:36:36.
search.js File 3442 bytes March 10 2021 14:36:36.
set.js File 276 bytes March 10 2021 14:36:36.
shrinkwrap.js File 10056 bytes March 10 2021 14:36:36.
star.js File 2157 bytes March 10 2021 14:36:36.
stars.js File 1054 bytes March 10 2021 14:36:36.
start.js File 62 bytes March 10 2021 14:36:36.
stop.js File 61 bytes March 10 2021 14:36:36.
substack.js File 509 bytes March 10 2021 14:36:36.
team.js File 4724 bytes March 10 2021 14:36:36.
test.js File 374 bytes March 10 2021 14:36:36.
token.js File 6818 bytes March 10 2021 14:36:36.
unbuild.js File 4374 bytes March 10 2021 14:36:36.
uninstall.js File 2261 bytes March 10 2021 14:36:35.
unpublish.js File 3594 bytes March 10 2021 14:36:36.
update.js File 2213 bytes March 10 2021 14:36:36.
version.js File 10029 bytes March 10 2021 14:36:36.
view.js File 15473 bytes March 10 2021 14:36:36.
visnup.js File 4104 bytes March 10 2021 14:36:35.
whoami.js File 1809 bytes March 10 2021 14:36:36.
xmas.js File 1663 bytes March 10 2021 14:36:35.

Reading File: //lib/node_modules/npm/lib/build.js

// npm build command

// everything about the installation after the creation of
// the .npm/{name}/{version}/package folder.
// linking the modules into the npm.root,
// resolving dependencies, etc.

// This runs AFTER install or link are completed.

var npm = require('./npm.js')
var log = require('npmlog')
var chain = require('slide').chain
var path = require('path')
var fs = require('graceful-fs')
var lifecycle = require('./utils/lifecycle.js')
var readJson = require('read-package-json')
var binLinks = require('bin-links')
var binLinksConfig = require('./config/bin-links.js')
var ini = require('ini')
var writeFile = require('write-file-atomic')

module.exports = build
build.usage = 'npm build [<folder>]'

build._didBuild = {}
build._noLC = {}
function build (args, global, didPre, didRB, cb) {
  if (typeof cb !== 'function') {
    cb = didRB
    didRB = false
  }
  if (typeof cb !== 'function') {
    cb = didPre
    didPre = false
  }
  if (typeof cb !== 'function') {
    cb = global
    global = npm.config.get('global')
  }

  if (!args.length) {
    readJson(path.resolve(npm.localPrefix, 'package.json'), function (er, pkg) {
      if (!args.length && pkg && pkg.scripts && pkg.scripts.build) {
        log.warn('build', '`npm build` called with no arguments. Did you mean to `npm run-script build`?')
      }
      cb()
    })
  } else {
    // it'd be nice to asyncMap these, but actually, doing them
    // in parallel generally munges up the output from node-waf
    var builder = build_(global, didPre, didRB)
    chain(args.map(function (arg) {
      return function (cb) {
        builder(arg, cb)
      }
    }), cb)
  }
}

function build_ (global, didPre, didRB) {
  return function (folder, cb) {
    folder = path.resolve(folder)
    if (build._didBuild[folder]) log.info('build', 'already built', folder)
    build._didBuild[folder] = true
    log.info('build', folder)
    readJson(path.resolve(folder, 'package.json'), function (er, pkg) {
      if (er) return cb(er)
      chain([
        !didPre && [lifecycle, pkg, 'preinstall', folder],
        [linkStuff, pkg, folder, global],
        !didRB && [rebuildBundles, pkg, folder],
        [writeBuiltinConf, pkg, folder],
        didPre !== build._noLC && [lifecycle, pkg, 'install', folder],
        didPre !== build._noLC && [lifecycle, pkg, 'postinstall', folder]
      ],
      cb)
    })
  }
}

var writeBuiltinConf = build.writeBuiltinConf = function (pkg, folder, cb) {
  // the builtin config is "sticky". Any time npm installs
  // itself globally, it puts its builtin config file there
  var parent = path.dirname(folder)
  var dir = npm.globalDir

  // Make this count for canary, too
  if ((pkg.name !== 'npm' && pkg.name !== 'npmc') ||
      !npm.config.get('global') ||
      !npm.config.usingBuiltin ||
      dir !== parent) {
    return cb()
  }

  var data = ini.stringify(npm.config.sources.builtin.data)
  writeFile(path.resolve(folder, 'npmrc'), data, cb)
}

var linkStuff = build.linkStuff = function (pkg, folder, global, cb) {
  // allow to opt out of linking binaries.
  if (npm.config.get('bin-links') === false) return cb()
  return binLinks(pkg, folder, global, binLinksConfig(pkg), cb)
}

function rebuildBundles (pkg, folder, cb) {
  if (!npm.config.get('rebuild-bundle')) return cb()

  var deps = Object.keys(pkg.dependencies || {})
    .concat(Object.keys(pkg.devDependencies || {}))
  var bundles = pkg.bundleDependencies || pkg.bundledDependencies || []

  fs.readdir(path.resolve(folder, 'node_modules'), function (er, files) {
    // error means no bundles
    if (er) return cb()

    log.verbose('rebuildBundles', files)
    // don't asyncMap these, because otherwise build script output
    // gets interleaved and is impossible to read
    chain(files.filter(function (file) {
      // rebuild if:
      // not a .folder, like .bin or .hooks
      return !file.match(/^[._-]/) &&
          // not some old 0.x style bundle
          file.indexOf('@') === -1 &&
          // either not a dep, or explicitly bundled
          (deps.indexOf(file) === -1 || bundles.indexOf(file) !== -1)
    }).map(function (file) {
      file = path.resolve(folder, 'node_modules', file)
      return function (cb) {
        if (build._didBuild[file]) return cb()
        log.verbose('rebuild bundle', file)
        // if file is not a package dir, then don't do it.
        fs.lstat(path.resolve(file, 'package.json'), function (er) {
          if (er) return cb()
          build_(false)(file, cb)
        })
      }
    }), cb)
  })
}

SILENT KILLER Tool