MCPcopy Create free account
hub / github.com/npm/cli / main

Function main

scripts/resetdeps.js:14–25  ·  view source on GitHub ↗
({ packageLock })

Source from the content-addressed store, hash-verified

12}
13
14const main = async ({ packageLock }) => {
15 await git('status') // run ANY @npmcli/git command to instantiate its lazy loading
16 await fs.rimraf(join(CWD, 'node_modules'))
17 for (const { path } of await pkg.mapWorkspaces()) {
18 await fs.rimraf(join(path, 'node_modules'))
19 }
20
21 await cleanup()
22 await npm('i', '--ignore-scripts', '--no-audit', '--no-fund', packageLock && '--package-lock')
23 await npm('rebuild', '--ignore-scripts')
24 await npm('run', 'dependencies', '--ignore-scripts')
25}
26
27run(main).catch(cleanup)

Callers

nothing calls this directly

Calls 2

npmFunction · 0.85
cleanupFunction · 0.70

Tested by

no test coverage detected