����JFIF��x�x����'
| Server IP : 78.140.185.180 / Your IP : 216.73.216.220 Web Server : LiteSpeed System : Linux cpanel13.v.fozzy.com 4.18.0-513.11.1.lve.el8.x86_64 #1 SMP Thu Jan 18 16:21:02 UTC 2024 x86_64 User : builderbox ( 1072) PHP Version : 7.3.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /opt/alt/alt-nodejs24/root/usr/lib/node_modules/npm/node_modules/libnpmdiff/lib/ |
Upload File : |
const { relative } = require('node: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) =>
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