MCPcopy Create free account
hub / github.com/nodejs/node / createNpxCacheEntry

Function createNpxCacheEntry

deps/npm/test/lib/commands/cache.js:12–24  ·  view source on GitHub ↗
(npxCacheDir, hash, pkgJson, shrinkwrapJson)

Source from the content-addressed store, hash-verified

10const pkg = 'test-package'
11
12const createNpxCacheEntry = (npxCacheDir, hash, pkgJson, shrinkwrapJson) => {
13 fs.mkdirSync(path.join(npxCacheDir, hash))
14 fs.writeFileSync(
15 path.join(npxCacheDir, hash, 'package.json'),
16 JSON.stringify(pkgJson)
17 )
18 if (shrinkwrapJson) {
19 fs.writeFileSync(
20 path.join(npxCacheDir, hash, 'npm-shrinkwrap.json'),
21 JSON.stringify(shrinkwrapJson)
22 )
23 }
24}
25
26t.cleanSnapshot = str => {
27 return cleanCwd(str)

Callers 1

cache.jsFile · 0.85

Calls 3

mkdirSyncMethod · 0.45
joinMethod · 0.45
writeFileSyncMethod · 0.45

Tested by

no test coverage detected