REDROOM
PHP 8.2.30
Path:
Logout
Edit File
Size: 3.15 KB
Close
/opt/alt/alt-nodejs9/root/usr/lib/node_modules/npm/node_modules/pacote/tarball.js
Text
Base64
'use strict' const BB = require('bluebird') const cacache = require('cacache') const fs = require('fs') const getStream = require('get-stream') const mkdirp = BB.promisify(require('mkdirp')) const npa = require('npm-package-arg') const optCheck = require('./lib/util/opt-check') const path = require('path') const pipe = BB.promisify(require('mississippi').pipe) module.exports = tarball function tarball (spec, opts) { opts = optCheck(opts) spec = npa(spec, opts.where) const startTime = Date.now() if (opts.integrity && !opts.preferOnline) { opts.log.silly('tarball', 'checking if', opts.integrity, 'is already cached') return cacache.get.byDigest(opts.cache, opts.integrity).then(data => { if (data) { opts.log.silly('tarball', `cached content available for ${spec} (${Date.now() - startTime}ms)`) return data } else { return getStream.buffer(tarballByManifest(startTime, spec, opts)) } }) } else { opts.log.silly('tarball', `no integrity hash provided for ${spec} - fetching by manifest`) return getStream.buffer(tarballByManifest(startTime, spec, opts)) } } module.exports.stream = tarballStream function tarballStream (spec, opts) { opts = optCheck(opts) spec = npa(spec, opts.where) const startTime = Date.now() if (opts.integrity && !opts.preferOnline) { opts.log.silly('tarball', 'checking if', opts.integrity, 'is already cached') return cacache.get.hasContent(opts.cache, opts.integrity).then(info => { if (info) { opts.log.silly('tarball', `cached content available for ${spec} (${Date.now() - startTime}ms)`) return cacache.get.stream.byDigest(opts.cache, opts.integrity, opts) } else { return tarballByManifest(startTime, spec, opts) } }) } else { opts.log.silly('tarball', `no integrity hash provided for ${spec} - fetching by manifest`) return tarballByManifest(startTime, spec, opts) } } module.exports.toFile = tarballToFile function tarballToFile (spec, dest, opts) { opts = optCheck(opts) spec = npa(spec, opts.where) const startTime = Date.now() return mkdirp(path.dirname(dest)).then(() => { if (opts.integrity && !opts.preferOnline) { opts.log.silly('tarball', 'checking if', opts.integrity, 'is already cached') return cacache.get.copy.byDigest(opts.cache, opts.integrity, dest, opts) .then(() => { opts.log.silly('tarball', `cached content for ${spec} copied (${Date.now() - startTime}ms)`) }, err => { if (err.code === 'ENOENT') { return pipe( tarballByManifest(startTime, spec, opts), fs.createWriteStream(dest) ) } else { throw err } }) } else { opts.log.silly('tarball', `no integrity hash provided for ${spec} - fetching by manifest`) return pipe( tarballByManifest(startTime, spec, opts), fs.createWriteStream(dest) ) } }) } let fetch function tarballByManifest (start, spec, opts) { if (!fetch) { fetch = require('./lib/fetch') } return fetch.tarball(spec, opts).on('end', () => { opts.log.silly('tarball', `${spec} done in ${Date.now() - start}ms`) }) }
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 2 × Files: 9
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:42:04
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:42:03
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
CHANGELOG.md
30.03 KB
lrw-r--r--
2021-09-28 11:28:25
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
extract.js
3.38 KB
lrw-r--r--
2021-09-28 11:28:25
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
index.js
225 B
lrw-r--r--
2021-09-28 11:28:25
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
LICENSE
1.05 KB
lrw-r--r--
2021-09-28 11:28:25
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
manifest.js
1.12 KB
lrw-r--r--
2021-09-28 11:28:25
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
package.json
3.24 KB
lrw-r--r--
2021-09-28 11:28:25
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
prefetch.js
1.93 KB
lrw-r--r--
2021-09-28 11:28:25
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
README.md
6.74 KB
lrw-r--r--
2021-09-28 11:28:21
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
tarball.js
3.15 KB
lrw-r--r--
2021-09-28 11:28:25
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).