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

Function reifyFinish

deps/npm/lib/utils/reify-finish.js:8–23  ·  view source on GitHub ↗
(npm, arb)

Source from the content-addressed store, hash-verified

6const { resolve } = require('node:path')
7
8const reifyFinish = async (npm, arb) => {
9 // if we are using a builtin config, and just installed npm as a top-level global package, we have to preserve that config.
10 if (arb.options.global) {
11 const npmNode = arb.actualTree.inventory.get('node_modules/npm')
12 if (npmNode) {
13 const builtinConf = npm.config.data.get('builtin')
14 if (!builtinConf.loadError) {
15 const content = ini.stringify(builtinConf.raw).trim() + '\n'
16 await writeFile(resolve(npmNode.path, 'npmrc'), content)
17 }
18 }
19 }
20 warnWorkspaceAllowScripts(arb.actualTree)
21 const unreviewedScripts = await checkAllowScripts({ arb, npm })
22 reifyOutput(npm, arb, { unreviewedScripts })
23}
24
25module.exports = reifyFinish

Callers 11

updateWorkspacesFunction · 0.85
execMethod · 0.85
execMethod · 0.85
auditAdvisoriesMethod · 0.85
linkInstallMethod · 0.85
linkPkgMethod · 0.85
execMethod · 0.85
execMethod · 0.85
execMethod · 0.85
execMethod · 0.85
mockReififyFinishFunction · 0.85

Calls 6

checkAllowScriptsFunction · 0.85
reifyOutputFunction · 0.85
getMethod · 0.65
writeFileFunction · 0.50
resolveFunction · 0.50

Tested by

no test coverage detected