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

Function cleanup

scripts/resetdeps.js:5–12  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3const { CWD, run, pkg, fs, git, npm } = require('./util.js')
4
5const cleanup = async () => {
6 await git('checkout', 'node_modules/')
7 for (const { name, path } of await pkg.mapWorkspaces({ public: true })) {
8 // add symlinks similar to how arborist does for our production
9 // workspaces, so they are in place before the initial install.
10 await symlink(path, join(CWD, 'node_modules', name), 'junction')
11 }
12}
13
14const main = async ({ packageLock }) => {
15 await git('status') // run ANY @npmcli/git command to instantiate its lazy loading

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected