REDROOM
PHP 8.2.30
Path:
Logout
Edit File
Size: 3.15 KB
Close
/opt/alt/alt-nodejs19/root/lib/node_modules/npm/node_modules/pacote/lib/dir.js
Text
Base64
const Fetcher = require('./fetcher.js') const FileFetcher = require('./file.js') const Minipass = require('minipass') const tarCreateOptions = require('./util/tar-create-options.js') const packlist = require('npm-packlist') const tar = require('tar') const _prepareDir = Symbol('_prepareDir') const { resolve } = require('path') const _readPackageJson = Symbol.for('package.Fetcher._readPackageJson') const runScript = require('@npmcli/run-script') const _tarballFromResolved = Symbol.for('pacote.Fetcher._tarballFromResolved') class DirFetcher extends Fetcher { constructor (spec, opts) { super(spec, opts) // just the fully resolved filename this.resolved = this.spec.fetchSpec this.tree = opts.tree || null this.Arborist = opts.Arborist || null } // exposes tarCreateOptions as public API static tarCreateOptions (manifest) { return tarCreateOptions(manifest) } get types () { return ['directory'] } [_prepareDir] () { return this.manifest().then(mani => { if (!mani.scripts || !mani.scripts.prepare) { return } // we *only* run prepare. // pre/post-pack is run by the npm CLI for publish and pack, // but this function is *also* run when installing git deps const stdio = this.opts.foregroundScripts ? 'inherit' : 'pipe' // hide the banner if silent opt is passed in, or if prepare running // in the background. const banner = this.opts.silent ? false : stdio === 'inherit' return runScript({ pkg: mani, event: 'prepare', path: this.resolved, stdio, banner, env: { npm_package_resolved: this.resolved, npm_package_integrity: this.integrity, npm_package_json: resolve(this.resolved, 'package.json'), }, }) }) } [_tarballFromResolved] () { if (!this.tree && !this.Arborist) { throw new Error('DirFetcher requires either a tree or an Arborist constructor to pack') } const stream = new Minipass() stream.resolved = this.resolved stream.integrity = this.integrity const { prefix, workspaces } = this.opts // run the prepare script, get the list of files, and tar it up // pipe to the stream, and proxy errors the chain. this[_prepareDir]() .then(async () => { if (!this.tree) { const arb = new this.Arborist({ path: this.resolved }) this.tree = await arb.loadActual() } return packlist(this.tree, { path: this.resolved, prefix, workspaces }) }) .then(files => tar.c(tarCreateOptions(this.package), files) .on('error', er => stream.emit('error', er)).pipe(stream)) .catch(er => stream.emit('error', er)) return stream } manifest () { if (this.package) { return Promise.resolve(this.package) } return this[_readPackageJson](this.resolved + '/package.json') .then(mani => this.package = { ...mani, _integrity: this.integrity && String(this.integrity), _resolved: this.resolved, _from: this.from, }) } packument () { return FileFetcher.prototype.packument.apply(this) } } module.exports = DirFetcher
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 1 × Files: 8
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
util
DIR
-
drwxr-xr-x
2024-03-03 22:54:11
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
bin.js
3.91 KB
lrwxr-xr-x
2023-12-06 18:07:51
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
dir.js
3.15 KB
lrw-r--r--
2023-12-06 18:07:51
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
fetcher.js
16.67 KB
lrw-r--r--
2023-12-06 18:07:51
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
file.js
2.65 KB
lrw-r--r--
2023-12-06 18:07:51
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
git.js
11.48 KB
lrw-r--r--
2023-12-06 18:07:51
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
index.js
826 B
lrw-r--r--
2023-12-06 18:07:51
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
registry.js
13.00 KB
lrw-r--r--
2023-12-06 18:07:51
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
remote.js
2.73 KB
lrw-r--r--
2023-12-06 18:07: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).