REDROOM
PHP 8.2.30
Path:
Logout
Edit File
Size: 2.49 KB
Close
//opt/alt/alt-nodejs22/root/usr/lib/node_modules/npm/node_modules/pacote/lib/file.js
Text
Base64
const { resolve } = require('node:path') const { stat, chmod } = require('node:fs/promises') const cacache = require('cacache') const fsm = require('fs-minipass') const Fetcher = require('./fetcher.js') const _ = require('./util/protected.js') class FileFetcher extends Fetcher { constructor (spec, opts) { super(spec, opts) // just the fully resolved filename this.resolved = this.spec.fetchSpec } get types () { return ['file'] } manifest () { if (this.package) { return Promise.resolve(this.package) } // have to unpack the tarball for this. return cacache.tmp.withTmp(this.cache, this.opts, dir => this.extract(dir) .then(() => this[_.readPackageJson](dir)) .then(mani => this.package = { ...mani, _integrity: this.integrity && String(this.integrity), _resolved: this.resolved, _from: this.from, })) } #exeBins (pkg, dest) { if (!pkg.bin) { return Promise.resolve() } return Promise.all(Object.keys(pkg.bin).map(async k => { const script = resolve(dest, pkg.bin[k]) // Best effort. Ignore errors here, the only result is that // a bin script is not executable. But if it's missing or // something, we just leave it for a later stage to trip over // when we can provide a more useful contextual error. try { const st = await stat(script) const mode = st.mode | 0o111 if (mode === st.mode) { return } await chmod(script, mode) } catch { // Ignore errors here } })) } extract (dest) { // if we've already loaded the manifest, then the super got it. // but if not, read the unpacked manifest and chmod properly. return super.extract(dest) .then(result => this.package ? result : this[_.readPackageJson](dest).then(pkg => this.#exeBins(pkg, dest)).then(() => result)) } [_.tarballFromResolved] () { // create a read stream and return it return new fsm.ReadStream(this.resolved) } packument () { // simulate based on manifest return this.manifest().then(mani => ({ name: mani.name, 'dist-tags': { [this.defaultTag]: mani.version, }, versions: { [mani.version]: { ...mani, dist: { tarball: `file:${this.resolved}`, integrity: this.integrity && String(this.integrity), }, }, }, })) } } module.exports = FileFetcher
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 1 × Files: 7
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
util
DIR
-
drwxr-xr-x
2026-03-14 07:02:09
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
dir.js
2.96 KB
lrw-r--r--
2026-02-23 06:54:00
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
fetcher.js
16.45 KB
lrw-r--r--
2026-02-23 06:54:00
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
file.js
2.49 KB
lrw-r--r--
2026-02-23 06:54:00
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
git.js
10.87 KB
lrw-r--r--
2026-02-23 06:54:00
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
index.js
808 B
lrw-r--r--
2026-02-23 06:54:00
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
registry.js
14.03 KB
lrw-r--r--
2026-02-23 06:54:00
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
remote.js
2.60 KB
lrw-r--r--
2026-02-23 06:54:00
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).