File: resetdeps.js

package info (click to toggle)
npm 9.2.0~ds1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 318,988 kB
  • sloc: javascript: 167,820; sh: 194; makefile: 52; perl: 11
file content (19 lines) | stat: -rw-r--r-- 590 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

const { join } = require('path')
const { CWD, run, pkg, fs, git, npm } = require('./util.js')

const checkout = () => git('checkout', 'node_modules/')

const main = async ({ packageLock }) => {
  await fs.rimraf(join(CWD, 'node_modules'))
  for (const { path } of await pkg.mapWorkspaces()) {
    await fs.rimraf(join(path, 'node_modules'))
  }

  await checkout()
  await npm('i', '--ignore-scripts', '--no-audit', '--no-fund', packageLock && '--package-lock')
  await npm('rebuild', '--ignore-scripts')
  await npm('run', 'dependencies', '--ignore-scripts')
}

run(main).catch(checkout)