REDROOM
PHP 8.2.30
Path:
Logout
Edit File
Size: 2.10 KB
Close
/opt/alt/alt-nodejs11/root/lib/node_modules/npm/node_modules/pacote/extract.js
Text
Base64
'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 }) }
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 2 × Files: 10
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
lib
DIR
-
drwxr-xr-x
2024-03-03 22:41:37
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
node_modules
DIR
-
drwxr-xr-x
2024-03-03 22:41:36
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
CHANGELOG.md
39.99 KB
lrw-r--r--
2021-10-19 09:47:51
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
extract.js
2.10 KB
lrw-r--r--
2021-10-19 09:47:51
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
index.js
262 B
lrw-r--r--
2021-10-19 09:47:51
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
LICENSE
1.05 KB
lrw-r--r--
2021-10-19 09:47:51
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
manifest.js
1.12 KB
lrw-r--r--
2021-10-19 09:47:51
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
package.json
3.17 KB
lrw-r--r--
2021-10-19 09:47:51
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
packument.js
822 B
lrw-r--r--
2021-10-19 09:47:51
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
prefetch.js
1.93 KB
lrw-r--r--
2021-10-19 09:47:51
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
README.md
9.59 KB
lrw-r--r--
2021-10-19 09:47:51
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
tarball.js
1.97 KB
lrw-r--r--
2021-10-19 09:47:51
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).