Identify Where a File is Used
Find all entry points that implicitly require a specific file, along with resolution paths.Check If a File is Used
Quickly see how many entry points depend on a file without showing the full paths.Identify Dead Files
Discover files that are not imported by any other file and may be safe to delete.Basic Usage
Exclude Known Entry Points
For more accurate results, exclude framework entry points and known valid entry points:List All Files Imported by an Entry Point
See the complete dependency tree for a specific entry point.- Identifying heavy components
- Finding unintended dependencies
- Understanding bundle size contributors
Count Only
Get just the number of dependencies:Reduce Unnecessary Imports
Follow this workflow to optimize your entry point’s dependencies:Identify suspicious files
Look for files that shouldn’t be in this dependency tree (e.g., heavy libraries, unrelated modules)
This technique is particularly effective for reducing bundle sizes and removing accidental dependencies.
Detect Circular Dependencies
Find all circular dependency chains in your project.Ignore Type Imports
Circular dependencies in TypeScript type imports are usually harmless:With Monorepo Support
Find Unused Node Modules
Discover dependencies declared in package.json but never imported in your code.Exclude Specific Modules
Count Only
Performance Tip
Rev-dep can analyze a 500k+ LoC project for unused modules in around 287ms - up to 22x faster than alternatives.
Find Missing Node Modules
Identify packages imported in your code but not declared in package.json.Group by Module
Group by File
Check node_modules Space Usage
Analyze disk space usage by your node_modules directories.- Calculates cumulative file sizes in node_modules directories
- Shows size for the current directory and subdirectories
- Helps identify space optimization opportunities
Sizes shown are actual file sizes rather than disk space usage (which may differ due to disk block allocation).
Advanced Resolution Techniques
Find All Paths Between Files
Show every possible dependency path from an entry point to a target file:Check Direct Importers
See only files that directly import a specific file:Exclude Files from Analysis
Count Lines of Code
Get an accurate count of effective lines of code, excluding comments and blank lines:List Source Files
Recursively list all files in the current working directory with filtering:Count Files Only
Combining Commands for Powerful Workflows
These exploratory commands complement the config-based checks, giving you both automated governance and manual investigation capabilities.
