$77 GRAYBYTE WORDPRESS FILE MANAGER $77

SERVER : vnpttt-amd7f72-h1.vietnix.vn #1 SMP Fri May 24 12:42:50 UTC 2024
SERVER IP : 103.200.23.149 | ADMIN IP 216.73.216.22
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/opt/alt/alt-nodejs6/root/usr/lib/node_modules/npm/lib/install/action/

HOME
Current File : /opt/alt/alt-nodejs6/root/usr/lib/node_modules/npm/lib/install/action//extract.js
'use strict'
var path = require('path')
var iferr = require('iferr')
var asyncMap = require('slide').asyncMap
var fs = require('graceful-fs')
var rename = require('../../utils/rename.js')
var gentlyRm = require('../../utils/gently-rm.js')
var updatePackageJson = require('../update-package-json')
var npm = require('../../npm.js')
var moduleName = require('../../utils/module-name.js')
var packageId = require('../../utils/package-id.js')
var cache = require('../../cache.js')
var buildPath = require('../build-path.js')

module.exports = function (top, buildpath, pkg, log, next) {
  log.silly('extract', packageId(pkg))
  var up = npm.config.get('unsafe-perm')
  var user = up ? null : npm.config.get('user')
  var group = up ? null : npm.config.get('group')
  cache.unpack(pkg.package.name, pkg.package.version, buildpath, null, null, user, group,
        andUpdatePackageJson(pkg, buildpath, andStageBundledChildren(pkg, buildpath, log, next)))
}

function andUpdatePackageJson (pkg, buildpath, next) {
  return iferr(next, function () {
    updatePackageJson(pkg, buildpath, next)
  })
}

function andStageBundledChildren (pkg, buildpath, log, next) {
  var staging = path.resolve(buildpath, '..')
  return iferr(next, function () {
    for (var i = 0; i < pkg.children.length; ++i) {
      var c = pkg.children[i]
      if (!c.package.name) return next(c.error)
    }

    asyncMap(pkg.children, andStageBundledModule(pkg, staging, buildpath), cleanupBundled)
  })
  function cleanupBundled () {
    gentlyRm(path.join(buildpath, 'node_modules'), next)
  }
}

function andStageBundledModule (bundler, staging, parentPath) {
  return function (child, next) {
    stageBundledModule(bundler, child, staging, parentPath, next)
  }
}

function getTree (pkg) {
  while (pkg.parent) pkg = pkg.parent
  return pkg
}

function warn (pkg, code, msg) {
  var tree = getTree(pkg)
  var err = new Error(msg)
  err.code = code
  tree.warnings.push(err)
}

function stageBundledModule (bundler, child, staging, parentPath, next) {
  var stageFrom = path.join(parentPath, 'node_modules', child.package.name)
  var stageTo = buildPath(staging, child)

  asyncMap(child.children, andStageBundledModule(bundler, staging, stageFrom), iferr(next, moveModule))

  function moveModule () {
    if (child.fromBundle) {
      return rename(stageFrom, stageTo, iferr(next, updateMovedPackageJson))
    } else {
      return fs.stat(stageFrom, function (notExists, exists) {
        if (exists) {
          warn(bundler, 'EBUNDLEOVERRIDE', 'In ' + packageId(bundler) +
            ' replacing bundled version of ' + moduleName(child) +
            ' with ' + packageId(child))
          return gentlyRm(stageFrom, next)
        } else {
          return next()
        }
      })
    }
  }

  function updateMovedPackageJson () {
    updatePackageJson(child, stageTo, next)
  }
}

Current_dir [ NOT WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
31 Aug 2024 8.02 AM
root / root
0755
build.js
0.415 KB
28 Sep 2021 4.36 PM
root / root
0644
extract.js
2.793 KB
28 Sep 2021 4.36 PM
root / root
0644
fetch.js
0.861 KB
28 Sep 2021 4.36 PM
root / root
0644
finalize.js
2.738 KB
28 Sep 2021 4.36 PM
root / root
0644
global-install.js
0.592 KB
28 Sep 2021 4.36 PM
root / root
0644
global-link.js
0.236 KB
28 Sep 2021 4.36 PM
root / root
0644
install.js
0.291 KB
28 Sep 2021 4.36 PM
root / root
0644
move.js
3.163 KB
28 Sep 2021 4.36 PM
root / root
0644
postinstall.js
0.299 KB
28 Sep 2021 4.36 PM
root / root
0644
preinstall.js
0.298 KB
28 Sep 2021 4.36 PM
root / root
0644
prepublish.js
0.298 KB
28 Sep 2021 4.36 PM
root / root
0644
remove.js
2.417 KB
28 Sep 2021 4.36 PM
root / root
0644
test.js
0.286 KB
28 Sep 2021 4.36 PM
root / root
0644
update-linked.js
0.348 KB
28 Sep 2021 4.36 PM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF