/
home2
/
dakshskx
/
nodejs
/
lib
/
node_modules
/
npm
/
node_modules
/
@npmcli
/
arborist
/
lib
/
/home2/dakshskx/nodejs/lib/node_modules/npm/node_modules/@npmcli/arborist/lib
mkdir
upload
Name
Size
Mode
Actions
arborist/
-
0755
rm
add-rm-pkg-deps.js
5010
0644
edit
dl
rm
audit-report.js
12282
0644
edit
dl
rm
calc-dep-flags.js
3148
0644
edit
dl
rm
can-place-dep.js
14273
0644
edit
dl
rm
case-insensitive-map.js
1356
0644
edit
dl
rm
consistent-resolve.js
1432
0644
edit
dl
rm
debug.js
1228
0644
edit
dl
rm
deepest-nesting-target.js
691
0644
edit
dl
rm
dep-valid.js
4990
0644
edit
dl
rm
diff.js
9798
0644
edit
dl
rm
edge.js
6983
0644
edit
dl
rm
from-path.js
1069
0644
edit
dl
rm
gather-dep-set.js
1286
0644
edit
dl
rm
get-workspace-nodes.js
863
0644
edit
dl
rm
index.js
353
0644
edit
dl
rm
inventory.js
3272
0644
edit
dl
rm
link.js
3691
0644
edit
dl
rm
node.js
44093
0644
edit
dl
rm
optional-set.js
1353
0644
edit
dl
rm
override-resolves.js
230
0644
edit
dl
rm
override-set.js
2603
0644
edit
dl
rm
peer-entry-sets.js
2632
0644
edit
dl
rm
place-dep.js
20207
0644
edit
dl
rm
printable.js
5217
0644
edit
dl
rm
query-selector-all.js
16827
0644
edit
dl
rm
realpath.js
2737
0644
edit
dl
rm
relpath.js
131
0644
edit
dl
rm
reset-dep-flags.js
638
0644
edit
dl
rm
retire-path.js
491
0644
edit
dl
rm
shrinkwrap.js
37913
0644
edit
dl
rm
signal-handling.js
2245
0644
edit
dl
rm
signals.js
1381
0644
edit
dl
rm
spec-from-lock.js
874
0644
edit
dl
rm
tracker.js
3373
0644
edit
dl
rm
tree-check.js
4121
0644
edit
dl
rm
version-from-tgz.js
1489
0644
edit
dl
rm
vuln.js
5858
0644
edit
dl
rm
yarn-lock.js
10289
0644
edit
dl
rm
Edit:
/home2/dakshskx/nodejs/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/realpath.js
(2737B)
// look up the realpath, but cache stats to minimize overhead // If the parent folder is in the realpath cache, then we just // lstat the child, since there's no need to do a full realpath // This is not a separate module, and is much simpler than Node's // built-in fs.realpath, because we only care about symbolic links, // so we can handle many fewer edge cases. const fs = require('fs') const promisify = require('util').promisify const readlink = promisify(fs.readlink) const lstat = promisify(fs.lstat) const { resolve, basename, dirname } = require('path') const realpathCached = (path, rpcache, stcache, depth) => { // just a safety against extremely deep eloops /* istanbul ignore next */ if (depth > 2000) { throw eloop(path) } path = resolve(path) if (rpcache.has(path)) { return Promise.resolve(rpcache.get(path)) } const dir = dirname(path) const base = basename(path) if (base && rpcache.has(dir)) { return realpathChild(dir, base, rpcache, stcache, depth) } // if it's the root, then we know it's real if (!base) { rpcache.set(dir, dir) return Promise.resolve(dir) } // the parent, what is that? // find out, and then come back. return realpathCached(dir, rpcache, stcache, depth + 1).then(() => realpathCached(path, rpcache, stcache, depth + 1)) } const lstatCached = (path, stcache) => { if (stcache.has(path)) { return Promise.resolve(stcache.get(path)) } const p = lstat(path).then(st => { stcache.set(path, st) return st }) stcache.set(path, p) return p } // This is a slight fib, as it doesn't actually occur during a stat syscall. // But file systems are giant piles of lies, so whatever. const eloop = path => Object.assign(new Error( `ELOOP: too many symbolic links encountered, stat '${path}'`), { errno: -62, syscall: 'stat', code: 'ELOOP', path: path, }) const realpathChild = (dir, base, rpcache, stcache, depth) => { const realdir = rpcache.get(dir) // that unpossible /* istanbul ignore next */ if (typeof realdir === 'undefined') { throw new Error('in realpathChild without parent being in realpath cache') } const realish = resolve(realdir, base) return lstatCached(realish, stcache).then(st => { if (!st.isSymbolicLink()) { rpcache.set(resolve(dir, base), realish) return realish } return readlink(realish).then(target => { const resolved = resolve(realdir, target) if (realish === resolved) { throw eloop(realish) } return realpathCached(resolved, rpcache, stcache, depth + 1) }).then(real => { rpcache.set(resolve(dir, base), real) return real }) }) } module.exports = realpathCached
Save
cmd:
run