Description
Compares package.json dependencies with actual imports in your codebase to identify potentially unused packages. This helps clean up your dependencies and reduce bundle size.Usage
Examples
Flags
List of conditions for package.json imports resolution (e.g. node, imports, default)
Only display the count of modules
Working directory for the command
Entry point file(s) to start analysis from (default: auto-detected)
List of modules to exclude from the output
Additional files to search for binary usages. Use paths relative to cwd
Additional files to search for module imports. Use paths relative to cwd
Enable resolution of imports from monorepo workspace packages. Pass without value to follow all, or pass package names
Help for unused
Exclude type imports from the analysis
List of modules to include in the output
Path to package.json
Additional package.json fields to check for binary usages
Path to tsconfig.json
Show warnings and verbose output
Use this flag to always return zero exit code
Use Cases
Dependency Cleanup
Identify dependencies listed in package.json that are no longer used in your code.
Reduce Bundle Size
Remove unused packages to reduce your project’s bundle size and installation time.
CI/CD Integration
Use
--zero-exit-code in CI pipelines to report unused dependencies without failing builds.