$51 GRAYBYTE WORDPRESS FILE MANAGER $31

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-nodejs11/root/usr/lib/node_modules/npm/node_modules.bundled/pacote/

HOME
Current File : /opt/alt/alt-nodejs11/root/usr/lib/node_modules/npm/node_modules.bundled/pacote//extract.js
'use strict'

const BB = require('bluebird')

const extractStream = require('./lib/extract-stream.js')
const fs = require('fs')
const mkdirp = BB.promisify(require('mkdirp'))
const npa = require('npm-package-arg')
const optCheck = require('./lib/util/opt-check.js')
const path = require('path')
const rimraf = BB.promisify(require('rimraf'))
const withTarballStream = require('./lib/with-tarball-stream.js')

const truncateAsync = BB.promisify(fs.truncate)
const readFileAsync = BB.promisify(fs.readFile)
const appendFileAsync = BB.promisify(fs.appendFile)

module.exports = extract
function extract (spec, dest, opts) {
  opts = optCheck(opts)
  spec = npa(spec, opts.where)
  const startTime = Date.now()

  return withTarballStream(spec, opts, stream => {
    return tryExtract(spec, stream, dest, opts)
  })
    .then(() => {
      if (!opts.resolved) {
        const pjson = path.join(dest, 'package.json')
        return readFileAsync(pjson, 'utf8')
          .then(str => truncateAsync(pjson)
            .then(() => appendFileAsync(pjson, str.replace(
              /}\s*$/,
              `\n,"_resolved": ${
                JSON.stringify(opts.resolved || '')
              }\n,"_integrity": ${
                JSON.stringify(opts.integrity || '')
              }\n,"_from": ${
                JSON.stringify(spec.toString())
              }\n}`
            ))))
      }
    })
    .then(() => opts.log.silly(
      'extract',
      `${spec} extracted to ${dest} (${Date.now() - startTime}ms)`
    ))
}

function tryExtract (spec, tarStream, dest, opts) {
  return new BB((resolve, reject) => {
    tarStream.on('error', reject)
    setImmediate(resolve)
  })
    .then(() => rimraf(dest))
    .then(() => mkdirp(dest))
    .then(() => new BB((resolve, reject) => {
      const xtractor = extractStream(spec, dest, opts)
      tarStream.on('error', reject)
      xtractor.on('error', reject)
      xtractor.on('close', resolve)
      tarStream.pipe(xtractor)
    }))
    .catch(err => {
      if (err.code === 'EINTEGRITY') {
        err.message = `Verification failed while extracting ${spec}:\n${err.message}`
      }
      throw err
    })
}

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
lib
--
31 Aug 2024 8.02 AM
root / root
0755
node_modules
--
31 Aug 2024 8.02 AM
root / root
0755
CHANGELOG.md
39.992 KB
19 Oct 2021 4.47 PM
root / root
0644
LICENSE
1.054 KB
19 Oct 2021 4.47 PM
root / root
0644
README.md
9.595 KB
19 Oct 2021 4.47 PM
root / root
0644
extract.js
2.104 KB
19 Oct 2021 4.47 PM
root / root
0644
index.js
0.256 KB
19 Oct 2021 4.47 PM
root / root
0644
manifest.js
1.12 KB
19 Oct 2021 4.47 PM
root / root
0644
package.json
3.165 KB
19 Oct 2021 4.47 PM
root / root
0644
packument.js
0.803 KB
19 Oct 2021 4.47 PM
root / root
0644
prefetch.js
1.932 KB
19 Oct 2021 4.47 PM
root / root
0644
tarball.js
1.975 KB
19 Oct 2021 4.47 PM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF