Skip to main content
Wright Websites

dead-deps-gauge

find unused dependencies

Find dependencies declared in package.json but never imported, and imports missing from package.json (or only in devDependencies).

  • 16/week on npm
  • 2★
  • MIT
  • v1.1.0
  • Supply Chain
npx dead-deps-gauge

Read the full README on GitHub (opens in a new tab)View on npm (opens in a new tab)

dead-deps-gauge

From the README

dead-deps-gauge reads every JavaScript and TypeScript file in a package, works out which packages each one imports, and compares that with package.json. Code that imports something not in package.json (and only works through hoisting), production code that needs a package listed only under devDependencies, and dependencies nothing uses all fail the build, each with the file and line and the exact command to fix it.

npx dead-deps-gauge                              # scan the current package
npx dead-deps-gauge packages/api --fail-on medium
npx dead-deps-gauge --ignore "generated/**" --ignore-deps "@company/runtime-*"
npx dead-deps-gauge -f json > deps-report.json

Related packages

Supply Chain