Description
Analyzes your code to identify which npm packages are actually being used. Helps keep track of your project’s runtime dependencies.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
Organize output by entry point file path
Organize output by entry point and show count of unique modules
Organize output by project file path
Organize output by npm package name
Organize output by npm package name and show count of entry points using it
Organize output by npm package name and show count of files using it
Organize output by npm package name and list entry points using it
Help for used
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 Cases
Track Runtime Dependencies
Identify which npm packages are actually being used in your codebase to maintain an accurate dependency list.
Monorepo Analysis
Use
--follow-monorepo-packages to analyze dependencies across workspace packages.Entry Point Analysis
Group by entry points to see which dependencies are used by different parts of your application.
