{"id":15823242,"url":"https://github.com/jayu/rev-dep","last_synced_at":"2026-03-16T21:32:56.076Z","repository":{"id":38278568,"uuid":"305319068","full_name":"jayu/rev-dep","owner":"jayu","description":"File dependency debugging tool for TypeScript projects","archived":false,"fork":false,"pushed_at":"2024-01-18T14:16:01.000Z","size":280,"stargazers_count":30,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-12T13:14:30.523Z","etag":null,"topics":["bundle","dependencies","dependencies-checking","dependency-analysis","dependency-debuging","dependency-graph","dependency-tree","deps","entry-points","file-dependencies","imports","imports-analysis","imports-debugging","imports-search","javascript","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jayu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-10-19T08:44:30.000Z","updated_at":"2025-04-09T11:48:12.000Z","dependencies_parsed_at":"2023-12-15T17:27:25.942Z","dependency_job_id":"ef05d5e4-a09f-4354-82f4-0e5f179be015","html_url":"https://github.com/jayu/rev-dep","commit_stats":{"total_commits":70,"total_committers":1,"mean_commits":70.0,"dds":0.0,"last_synced_commit":"4f9053beebe4c14b6f19869ee2095c1f5a2ae9f3"},"previous_names":[],"tags_count":29,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jayu%2Frev-dep","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jayu%2Frev-dep/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jayu%2Frev-dep/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jayu%2Frev-dep/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jayu","download_url":"https://codeload.github.com/jayu/rev-dep/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253745197,"owners_count":21957319,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bundle","dependencies","dependencies-checking","dependency-analysis","dependency-debuging","dependency-graph","dependency-tree","deps","entry-points","file-dependencies","imports","imports-analysis","imports-debugging","imports-search","javascript","typescript"],"created_at":"2024-10-05T08:06:49.760Z","updated_at":"2026-03-16T21:32:56.068Z","avatar_url":"https://github.com/jayu.png","language":"TypeScript","readme":"# Rev-dep\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://github.com/jayu/rev-dep/raw/master/logo.png\" width=\"400\" alt=\"Rev-dep logo\"\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"#capabilities-\"\u003eCapabilities\u003c/a\u003e\u0026nbsp;\u0026nbsp;•\u0026nbsp;\u0026nbsp;\n  \u003ca href=\"#installation-\"\u003eInstallation\u003c/a\u003e\u0026nbsp;\u0026nbsp;•\u0026nbsp;\u0026nbsp;\n  \u003ca href=\"#exploratory-toolkit-\"\u003eExploratory Toolkit\u003c/a\u003e\u0026nbsp;\u0026nbsp;•\u0026nbsp;\u0026nbsp;\n  \u003ca href=\"#cli-reference-\"\u003eCLI Reference\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  Dependency analysis and optimization toolkit for modern JavaScript and TypeScript codebases.  \n  \u003cbr\u003e\n  Enforce dependency graph hygiene and remove unused code with a very fast CLI.\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://github.com/jayu/rev-dep/raw/master/demo.png\" alt=\"Rev-dep config execution CLI output\" width=\"400\"\u003e\n\u003c/p\u003e\n\n---\n\n\u003cimg alt=\"rev-dep version\" src=\"https://img.shields.io/npm/v/rev-dep\"\u003e \u003cimg alt=\"rev-dep license\" src=\"https://img.shields.io/npm/l/rev-dep\"\u003e \u003cimg alt=\"rev-dep PRs welcome\" src=\"https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square\"\u003e\n\n## **About 📣**\n\nAs codebases scale, maintaining a mental map of dependencies becomes impossible. **Rev-dep** is a high-speed static analysis tool designed to enforce architecture integrity and dependency hygiene across large-scale JS/TS projects.\n\n\u003cp align=\"center\"\u003e\u003cb\u003eThink of Rev-dep as a high-speed linter for your dependency graph.\u003c/b\u003e\u003c/p\u003e\n\n**Consolidate fragmented, sequential checks from multiple slow tools into a single, high-performance engine.** Rev-dep executes a full suite of governance checks—including circularity, orphans, module boundaries and more, in one parallelized pass. Implemented in **Go** to bypass the performance bottlenecks of Node-based analysis, it can audit a **500k+ LoC project in approximately 500ms**.\n\n### **Automated Codebase Governance**\n\nRev-dep moves beyond passive scanning to active enforcement, answering (and failing CI for) the hard questions:\n\n* **Architecture Integrity:** \"Is my 'Domain A' illegally importing from 'Domain B'?\".\n* **Dead Code \u0026 Bloat:** \"Are these files unreachable, or are these `node_modules` unused?\".\n* **Refactoring Safety:** \"Which entry points actually use this utility, and are there circular chains?\".\n* **Workspace Hygiene:** \"Are my imports consistent and are all dependencies declared?\".\n\nRev-dep serves as a **high-speed gatekeeper** for your CI, ensuring your dependency graph remains lean and your architecture stays intact as you iterate.\n\n## **Why Rev-dep? 🤔**\n\n### 🏗️ **First-class monorepo support**\nDesigned for modern workspaces (`pnpm`, `yarn`, `npm`). Rev-dep natively resolves `package.json` **exports/imports** maps, TypeScript aliases and traces dependencies across package boundaries.\n\n### 🛡️ **Config-Based Codebase Governance**\nMove beyond passive scanning. Use the configuration engine to enforce **Module Boundaries** and **Import Conventions**. Execute a full suite of hygiene checks (circularity, orphans, unused modules and more) in a **single, parallelized pass** that serves as a high-speed gatekeeper for your CI.\n\n### 🔍 **Exploratory Toolkit**\nCLI toolkit that helps debug issues with dependencies between files. Understand transitive relation between files and fix issues.\n\n### ⚡ **Built for Speed and CI Efficiency**\nImplemented in **Go** to eliminate the performance tax of Node-based analysis. By processing files in parallel, Rev-dep offers **10x-200x faster execution** than alternatives, significantly **reducing CI costs** and developer wait-states.\n\n\u003e **Rev-dep can audit a 500k+ LoC project in around 500ms.**\n\u003e [See the performance comparison](#performance-comparison-)\n\n## Capabilities 🚀\n\n### Governance and maintenance (config-based) 🛡️\n\nUse `rev-dep config run` to execute multiple checks in one pass for all packages.\n\nAvailable checks:\n\n- `moduleBoundaries` - enforce architecture boundaries between modules.\n- `importConventions` - enforce import style conventions (offers autofix).\n- `unusedExportsDetection` - detect exports that are never used (offers autofix).\n- `orphanFilesDetection` - detect dead/orphan files (offers autofix).\n- `unusedNodeModulesDetection` - detect dependencies declared but not used.\n- `missingNodeModulesDetection` - detect imports missing from package json.\n- `unresolvedImportsDetection` - detect unresolved import requests.\n- `circularImportsDetection` - detect circular imports.\n- `devDepsUsageOnProdDetection` - detect dev dependencies used in production code.\n- `restrictedImportsDetection` - block importing denied files/modules from selected entry points.\n\n### Exploratory analysis (CLI-based) 🔍\n\nUse CLI commands for ad-hoc dependency exploration:\n\n- `entry-points` - discover project entry points.\n- `files` - list dependency tree files for a given entry point.\n- `resolve` - trace dependency paths between files (who imports this file).\n- `imported-by` - list direct importers of a file.\n- `circular` - list circular dependency chains.\n- `node-modules` - inspect `used`, `unused`, `missing`, and `installed` node modules.\n- `lines-of-code` - count effective LOC.\n- `list-cwd-files` - list all source code files in CWD\n\n## **Installation 📦**\n\n**Install locally to set up project check scripts**\n\n```\nyarn add -D rev-dep\n```\n\n```\nnpm install -D rev-dep\n```\n\n```\npnpm add -D rev-dep\n```\n\nCreate config file for a quick start:\n\n```\nnpx rev-dep config init\n```\n\n**Install globally to use as a CLI tool:**\n\n```\nyarn global add rev-dep\n```\n\n```\nnpm install -g rev-dep\n```\n\n```\npnpm global add rev-dep\n```\n\n## **Quick Examples 💡**\n\nA few instant-use examples to get a feel for the tool:\n\n```bash\n# Detect unused node modules\nrev-dep node-modules unused\n\n# Detect circular imports/dependencies\nrev-dep circular\n\n# List all entry points in the project\nrev-dep entry-points\n\n# Check which files an entry point imports\nrev-dep files --entry-point src/index.ts\n\n# Find every entry point that depends on a file\nrev-dep resolve --file src/utils/math.ts\n\n# Resolve dependency path between files\nrev-dep resolve --file src/utils/math.ts --entry-point src/index.ts\n\n```\n\n## Config-Based Checks 🛡️\n\nRev-dep provides a configuration system for orchestrating project checks. The config approach is **designed for speed** and is the **preferred way** of implementing project checks because it can execute all checks in a single pass, significantly faster than multiple running individual commands separately.\n\nAvailable checks are:\n\n- `moduleBoundaries` - enforce architecture boundaries between modules.\n- `importConventions` - enforce import style conventions (offers autofix).\n- `unusedExportsDetection` - detect exports that are never used (offers autofix).\n- `orphanFilesDetection` - detect dead/orphan files (offers autofix).\n- `unusedNodeModulesDetection` - detect dependencies declared but not used.\n- `missingNodeModulesDetection` - detect imports missing from package json.\n- `unresolvedImportsDetection` - detect unresolved import requests.\n- `circularImportsDetection` - detect circular imports.\n- `devDepsUsageOnProdDetection` - detect dev dependencies used in production code.\n- `restrictedImportsDetection` - block importing denied files/modules from selected entry points.\n\nChecks are grouped in rules. You can have multiple rules, eg. for each monorepo package.\n\n### Getting Started\n\nInitialize a configuration file in your project:\n\n```bash\n# Create a default configuration file\nrev-dep config init\n```\n\nBehavior of `rev-dep config init`:\n\n- Monorepo root: Running `rev-dep config init` at the workspace root creates a root rule and a rule for each discovered workspace package.\n- Monorepo workspace package or regular projects: Running `rev-dep config init` inside a directory creates config with a single rule with `path: \".\"` for this directory.\n\nRun all configured checks (dry run, not fixes applied yet):\n\n```bash\n# Execute all rules and checks defined in the config\nrev-dep config run\n```\n\nList all detected issues:\n```bash\n# Lists all detected issues, by default lists first five issues for each check\nrev-dep config run --list-all-issues\n```\n\nFix all fixable checks: \n\n```bash\n# Fix checks configured with autofix\nrev-dep config run --fix\n```\n\n### Configuration Structure\n\nThe configuration file (`rev-dep.config.json(c)` or `.rev-dep.config.json(c)`) allows you to define multiple rules, each targeting different parts of your codebase with specific checks enabled.\n\n#### Quick Start Configuration\n\n```jsonc\n{\n  \"configVersion\": \"1.6\",\n  \"$schema\": \"https://github.com/jayu/rev-dep/blob/master/config-schema/1.6.schema.json?raw=true\",\n  \"rules\": [\n    {\n      \"path\": \".\",\n      \"prodEntryPoints\": [\"src/main.tsx\", \"src/pages/**/*.tsx\"],\n      \"devEntryPoints\": [\"scripts/**\", \"**/*.test.*\"],\n      \"unusedExportsDetection\": {\n        \"enabled\": true,\n        \"autofix\": true\n      },\n      \"orphanFilesDetection\": {\n        \"enabled\": true,\n        \"autofix\": true\n      },\n      \"unusedNodeModulesDetection\": { \n        \"enabled\": true \n      },\n      \"circularImportsDetection\": { \n        \"enabled\": true \n      },\n      \"devDepsUsageOnProdDetection\": {\n        \"enabled\": true,\n        \"ignoreTypeImports\": true\n      }\n    }\n  ]\n}\n```\n\n#### Comprehensive Config Example\n\nHere's a comprehensive example showing all available properties:\n\n```jsonc\n{\n  \"configVersion\": \"1.6\",\n  \"$schema\": \"https://github.com/jayu/rev-dep/blob/master/config-schema/1.6.schema.json?raw=true\", // enables json autocompletion\n  \"conditionNames\": [\"import\", \"default\"],\n  \"ignoreFiles\": [\"**/*.test.*\"],\n  \"rules\": [\n    {\n      \"path\": \".\",\n      \"followMonorepoPackages\": true,\n      \"prodEntryPoints\": [\"src/main.tsx\", \"src/pages/**/*.tsx\", \"src/server.ts\"],\n      \"devEntryPoints\": [\"scripts/**\", \"**/*.test.*\"],\n      \"moduleBoundaries\": [\n        {\n          \"name\": \"ui-components\",\n          \"pattern\": \"src/components/**/*\",\n          \"allow\": [\"src/utils/**/*\", \"src/types/**/*\"],\n          \"deny\": [\"src/api/**/*\"]\n        },\n        {\n          \"name\": \"api-layer\",\n          \"pattern\": \"src/api/**/*\",\n          \"allow\": [\"src/utils/**/*\", \"src/types/**/*\"],\n          \"deny\": [\"src/components/**/*\"]\n        }\n      ],\n      \"importConventions\": [\n        {\n          \"rule\": \"relative-internal-absolute-external\",\n          \"autofix\": true,\n          \"domains\": [\n            {\n              \"path\": \"src/features/auth\",\n              \"alias\": \"@auth\",\n              \"enabled\": true\n            },\n            {\n              \"path\": \"src/shared/ui\",\n              \"alias\": \"@ui-kit\",\n              \"enabled\": false // checks disabled for this domain, but alias is still used for absolute imports from other domains\n            }\n          ]\n        }\n      ],\n      \"circularImportsDetection\": {\n        \"enabled\": true,\n        \"ignoreTypeImports\": true\n      },\n      \"orphanFilesDetection\": {\n        \"enabled\": true,\n        \"ignoreTypeImports\": true,\n        \"graphExclude\": [\"**/*.test.*\", \"**/stories/**/*\"],\n        \"autofix\": true\n      },\n      \"unusedNodeModulesDetection\": {\n        \"enabled\": true,\n        \"includeModules\": [\"@myorg/**\"],\n        \"excludeModules\": [\"@types/**\"],\n        \"pkgJsonFieldsWithBinaries\": [\"scripts\", \"bin\"],\n        \"filesWithBinaries\": [\"scripts/check-something.sh\"],\n        \"filesWithModules\": [\".storybook/main.ts\"],\n        \"outputType\": \"groupByModule\"\n      },\n      \"missingNodeModulesDetection\": {\n        \"enabled\": true,\n        \"includeModules\": [\"lodash\", \"axios\"],\n        \"excludeModules\": [\"@types/**\"],\n        \"outputType\": \"groupByFile\"\n      },\n      \"unusedExportsDetection\": {\n        \"enabled\": true,\n        \"autofix\": true,\n        \"ignoreTypeExports\": true,\n        \"graphExclude\": [\"**/*.stories.tsx\"],\n        \"ignore\": {\n          \"src/types.ts\": \"B*\",\n          \"**/generated/**/*.ts\": \"*\"\n        },\n        \"ignoreFiles\": [\"**/*.generated.ts\"],\n        \"ignoreExports\": [\"default\", \"unused*\"],\n      },\n      \"unresolvedImportsDetection\": {\n        \"enabled\": true,\n        \"ignore\": {\n          \"src/index.ts\": \"legacy-*\"\n        },\n        \"ignoreFiles\": [\"**/*.generated.ts\"],\n        \"ignoreImports\": [\"@internal/*\"]\n      },\n      \"devDepsUsageOnProdDetection\": {\n        \"enabled\": true,\n        \"ignoreTypeImports\": true\n      },\n      \"restrictedImportsDetection\": {\n        \"enabled\": true,\n        \"entryPoints\": [\"src/server.ts\", \"src/server/**/*.ts\"],\n        \"graphExclude\": [\"some-file-coupling-other-files.ts\"],\n        \"denyFiles\": [\"**/*.tsx\"],\n        \"denyModules\": [\"react\", \"react-*\"],\n        \"ignoreMatches\": [\"src/server/allowed-view.tsx\", \"react-awsome-lib\"],\n        \"ignoreTypeImports\": true\n      }\n    }\n  ]\n}\n```\n\n### Available Properties\n\n#### Root Level Properties\n- **`configVersion`** (required): Configuration version string\n- **`$schema`** (optional): JSON schema reference for validation\n- **`conditionNames`** (optional): Array of condition names for exports resolution\n- **`customAssetExtensions`** (optional): Additional asset extensions treated as resolvable imports (e.g. `[\"glb\", \"mp3\"]`). Default list covers common extensions for fonts, images, config files.\n- **`ignoreFiles`** (optional): Global file patterns to ignore across all rules. Git ignored files are skipped by default.\n- **`rules`** (required): Array of rule objects\n\n#### Rule Properties\nEach rule can contain the following properties:\n\n- **`path`** (required): Target directory path for this rule (either `.` or path starting with sub directory name)\n- **`followMonorepoPackages`** (optional): Control monorepo package resolution. `true` follows all workspace packages (default), `false` disables it, array follows only selected package names.\n- **`prodEntryPoints`** (optional): Rule-level production entry point patterns for detector defaults\n- **`devEntryPoints`** (optional): Rule-level development entry point patterns for detector defaults\n- **`moduleBoundaries`** (optional): Array of module boundary rules\n- **`circularImportsDetection`** (optional): Circular import detection configuration (single object or array of objects)\n- **`orphanFilesDetection`** (optional): Orphan files detection configuration (single object or array of objects)  \n- **`unusedNodeModulesDetection`** (optional): Unused node modules detection configuration (single object or array of objects)\n- **`missingNodeModulesDetection`** (optional): Missing node modules detection configuration (single object or array of objects)\n- **`unusedExportsDetection`** (optional): Unused exports detection configuration (single object or array of objects)\n- **`unresolvedImportsDetection`** (optional): Unresolved imports detection configuration (single object or array of objects)\n- **`devDepsUsageOnProdDetection`** (optional): Restricted dev dependencies usage detection configuration (single object or array of objects)\n- **`restrictedImportsDetection`** (optional): Restrict importing denied files/modules from selected entry points (single object or array of objects)\n- **`importConventions`** (optional): Array of import convention rules\n\n#### Module Boundary Properties\n- **`name`** (required): Name of the boundary\n- **`pattern`** (required): Glob pattern for files in this boundary\n- **`allow`** (optional): Array of allowed import patterns\n- **`deny`** (optional): Array of denied import patterns (overrides allow)\n\n#### Import Convention Properties\n- **`rule`** (required): Type of the rule, currently only `relative-internal-absolute-external`\n- **`autofix`** (optional): Whether to automatically fix import convention violations (default: false)\n- **`domains`** (required): Array of domain definitions. Can be a string (glob pattern) or an object with:\n  - **`path`** (required): Directory with the domain files\n  - **`alias`** (optional): Alias to be used for absolute imports of code from this domain\n  - **`enabled`** (optional): Set to `false` to skip checks for this domain (default: true)\n\n#### Detection Options Properties\n\nEach detection property can be configured as:\n- a single object (one detector instance), or\n- an array of objects (multiple detector instances evaluated within the same rule).\n\n**CircularImportsDetection:**\n- **`enabled`** (required): Enable/disable circular import detection\n- **`ignoreTypeImports`** (optional): Exclude type-only imports when building graph (default: false)\n\n**OrphanFilesDetection:**\n- **`enabled`** (required): Enable/disable orphan files detection\n- **`validEntryPoints`** (optional): Array of valid entry point patterns. If omitted, defaults to `prodEntryPoints + devEntryPoints` from rule level.\n- **`ignoreTypeImports`** (optional): Exclude type-only imports when building graph (default: false)\n- **`graphExclude`** (optional): File patterns to exclude from graph analysis\n- **`autofix`** (optional): Delete detected orphan files automatically when running `rev-dep config run --fix` (default: false)\n\n**UnusedNodeModulesDetection:**\n- **`enabled`** (required): Enable/disable unused modules detection\n- **`includeModules`** (optional): Module patterns to include in analysis\n- **`excludeModules`** (optional): Module patterns to exclude from analysis\n- **`pkgJsonFieldsWithBinaries`** (optional): Package.json fields containing binary references (eg. lint-staged). Performs plain-text lookup\n- **`filesWithBinaries`** (optional): File patterns to search for binary usage. Performs plain-text lookup\n- **`filesWithModules`** (optional): Non JS/TS file patterns to search for module imports (eg. shell scripts). Performs plain-text lookup\n- **`outputType`** (optional): Output format - \"list\", \"groupByModule\", \"groupByFile\"\n\n**MissingNodeModulesDetection:**\n- **`enabled`** (required): Enable/disable missing modules detection\n- **`includeModules`** (optional): Module patterns to include in analysis\n- **`excludeModules`** (optional): Module patterns to exclude from analysis\n- **`outputType`** (optional): Output format - \"list\", \"groupByModule\", \"groupByFile\", \"groupByModuleFilesCount\"\n\n**UnusedExportsDetection:**\n- **`enabled`** (required): Enable/disable unused exports detection\n- **`validEntryPoints`** (optional): Glob patterns for files whose exports are never reported as unused. If omitted, defaults to `prodEntryPoints + devEntryPoints` from rule level.\n- **`ignoreTypeExports`** (optional): Skip `export type` / `export interface` from analysis (default: false)\n- **`graphExclude`** (optional): File patterns to exclude from unused exports analysis\n- **`ignore`** (optional): Map of file path globs (relative to rule path directory) to export name/specifier glob(s) to suppress; each value can be a string or array of strings\n- **`ignoreFiles`** (optional): File path globs; all unused exports from matching files are suppressed\n- **`ignoreExports`** (optional): Export names/specifiers (or globs) to suppress globally (supports `\"default\"`)\n- **`autofix`** (optional): Automatically apply fixable unused exports changes when running `rev-dep config run --fix` (default: false)\n\n**UnresolvedImportsDetection:**\n- **`enabled`** (required): Enable/disable unresolved imports detection\n- **`ignore`** (optional): Map of file path globs (relative to rule path directory) to import request glob(s) to suppress; each value can be a string or array of strings\n- **`ignoreFiles`** (optional): File path globs; all unresolved imports from matching files are suppressed\n- **`ignoreImports`** (optional): Import requests (or globs) to suppress globally in unresolved results\n\n**DevDepsUsageOnProdDetection:**\n- **`enabled`** (required): Enable/disable restricted dev dependencies usage detection\n- **`prodEntryPoints`** (optional): Production entry point patterns to trace dependencies from. If omitted, defaults to rule-level `prodEntryPoints`.\n- **`ignoreTypeImports`** (optional): Exclude type-only imports from graph traversal and module matching (default: false)\n\n**RestrictedImportsDetection:**\n- **`enabled`** (required): Enable/disable restricted imports detection\n- **`entryPoints`** (required when enabled): Entry point patterns used to build reachable dependency graph (rule-level entry points are not applied here)\n- **`graphExclude`** (optional): File patterns to exclude from restricted imports graph analysis\n- **`denyFiles`** (optional): Denied file path patterns (eg. [\"**/*.tsx\"])\n- **`denyModules`** (optional): Denied module patterns (eg. [\"react\", \"react-*\"])\n- **`ignoreMatches`** (optional): File/module patterns to suppress from restricted import results\n- **`ignoreTypeImports`** (optional): Exclude type-only imports from traversal (default: false)\n\n### Performance Benefits\n\nThe configuration approach provides significant performance advantages:\n\n- **Single Dependency Tree Build**: Builds one comprehensive dependency tree for all rules\n- **Parallel Rule Execution**: Processes multiple rules simultaneously\n- **Parallel Check Execution**: Runs all enabled checks within each rule in parallel\n- **Optimized File Discovery**: Discovers files once and reuses across all checks\n\nThis makes config-based checks faster than running individual commands sequentially, especially for large codebases with multiple sub packages.\n\n## **Exploratory Toolkit 🔧**\n\nPractical examples show how to use rev-dep CLI commands to explore, debug or build code quality checks for your project.\n\n### **How to identify where a file is used in the project**\n\n```\nrev-dep resolve --file path/to/file.ts\n```\n\nYou’ll see all entry points that implicitly require that file, along with resolution paths.\n\n### **How to check if a file is used**\n\n```\nrev-dep resolve --file path/to/file.ts --compact-summary\n```\n\nShows how many entry points indirectly depend on the file.\n\n### **How to identify dead files**\n\n```\nrev-dep entry-points\n```\n\nExclude framework entry points if needed using `--result-exclude`.\n\nFor example exclude Next.js valid entry points when using pages router, exclude scripts directory - scripts are valid entry-points and exclude all test files:\n\n```\nrev-dep entry-points --result-exclude \"pages/**\",\"scripts/**\",\"**/*.test.*\"\n```\n\n### **How to list all files imported by an entry point**\n\n```\nrev-dep files --entry-point path/to/file.ts\n```\n\nUseful for identifying heavy components or unintended dependencies.\n\n### **How to reduce unnecessary imports for an entry point**\n\n1. List all files imported:\n\n   ```\n   rev-dep files --entry-point path/to/entry.ts\n   ```\n2. Identify suspicious files.\n3. Trace why they are included:\n\n   ```\n   rev-dep resolve --file path/to/suspect --entry-points path/to/entry.ts --all\n   ```\n\n### **How to detect circular dependencies**\n\n```\nrev-dep circular\n```\n\n### **How to find unused node modules**\n\n```\nrev-dep node-modules unused\n```\n\n### **How to find missing node modules**\n\n```\nrev-dep node-modules missing\n```\n\n### **How to check node_modules space usage**\n\n```\nrev-dep node-modules dirs-size\n```\n## Working with Monorepo 🏗️\n\nRev-dep provides first-class support for monorepo projects, enabling accurate dependency analysis across workspace packages.\n\n### followMonorepoPackages Flag\n\nThe `--follow-monorepo-packages` flag enables resolution of imports from monorepo workspace packages. By default, this flag is set to `false` to maintain compatibility with single-package projects.\n\n```bash\n# Enable monorepo package resolution\nrev-dep circular --follow-monorepo-packages\nrev-dep resolve --file src/utils.ts --follow-monorepo-packages\nrev-dep entry-points --follow-monorepo-packages\n```\n\nWhen enabled, rev-dep will:\n\n- **Detect workspace packages** automatically by scanning for monorepo configuration\n- **Resolve imports between packages** within the workspace\n- **Follow package.json exports** for proper module resolution\n\n### Exports Map Support\n\nRev-dep fully supports the `exports` field in package.json files, which is the standard way to define package entry points in modern Node.js projects.\n\nThe exports map support includes:\n\n- **Conditional exports** using conditions like `node`, `import`, `default`, and custom conditions\n- **Wildcard patterns** for flexible subpath mapping\n- **Sugar syntax** for simple main export definitions\n- **Nested conditions** for complex resolution scenarios\n\n### Condition Names Flag\n\nTo control which conditional exports are resolved, use the `--condition-names` flag. This allows you to specify the priority of conditions when resolving package exports:\n\n```bash\n# Resolve exports for different environments\nrev-dep circular --condition-names=node,import,default\nrev-dep resolve --file src/utils.ts --condition-names=import,node\nrev-dep entry-points --condition-names=default,node,import\n```\n\nThe conditions are processed in the order specified, with the first matching condition being used. Common conditions include:\n- `node` - Node.js environment\n- `import` - ES modules\n- `require` - CommonJS\n- `default` - Fallback condition\n- Custom conditions specific to your project or build tools\n\nExample package.json with exports:\n\n```json\n{\n  \"name\": \"@myorg/utils\",\n  \"exports\": {\n    \".\": {\n      \"import\": \"./dist/index.mjs\",\n      \"require\": \"./dist/index.js\",\n      \"default\": \"./dist/index.js\"\n    },\n    \"./helpers\": \"./dist/helpers.js\",\n    \"./types/*\": \"./dist/types/*.d.ts\"\n  }\n}\n```\n\n### How It Works\n\n1. **Monorepo Detection**: When `followMonorepoPackages` is enabled, rev-dep scans for workspace configuration (pnpm-workspace.yaml, package.json workspaces, etc.)\n\n2. **Package Resolution**: Imports to workspace packages are resolved using the package's exports configuration, falling back to main/module fields when exports are not defined\n\n3. **Dependency Validation**: The tool validates that cross-package imports are only allowed when the target package is listed in the consumer's dependencies or devDependencies\n\n4. **Path Resolution**: All paths are resolved relative to their respective package roots, ensuring accurate dependency tracking across the entire monorepo\n\nThis makes rev-dep particularly effective for large-scale monorepo projects where understanding cross-package dependencies is crucial for maintaining code quality and architecture.\n## Performance comparison ⚡\n\nRev-dep can perform multiple checks on 500k+ LoC monorepo with several sub-packages in around 500ms.\n\nIt outperforms Madge, dpdm, dependency-cruiser, skott, knip, depcheck and other similar tools.\n\nHere is a performance comparison of specific tasks between rev-dep and alternatives:\n\n| Task | Execution Time [ms] | Alternative | Alternative Time [ms] | Slower Than Rev-dep | \n|------|-------|--------------|------|----|\n| Find circular dependencies | 289 | dpdm-fast | 7061|  24x|\n| Find unused exports | 303 | knip| 6606 | 22x |\n| Find unused files | 277 | knip | 6596 | 23x |\n| Find unused node modules | 287 | knip | 6572 | 22x |\n| Find missing node modules | 270 | knip| 6568 | 24x |\n| List all files imported by an entry point | 229 | madge | 4467 | 20x | \n| Discover entry points | 323 | madge | 67000 | 207x\n| Resolve dependency path between files | 228 | please suggest | \n| Count lines of code | 342 | please suggest | \n| Check node_modules disk usage | 1619 | please suggest | \n| Analyze node_modules directory sizes | 521 | please suggest | \n\n\u003eBenchmark run on WSL Linux Debian Intel(R) Core(TM) i9-14900KF CPU @ 2.80GHz\n\n### Circular check performance comparison\n\nBenchmark performed on TypeScript codebase with `6034` source code files and `518862` lines of code.\n\nBenchmark performed on MacBook Pro with Apple M1 chip, 16GB of RAM and 256GB of Storage. Power save mode off.\n\nBenchmark performed with `hyperfine` using 8 runs per test and 4 warm up runs, taking mean time values as a result. If single run was taking more than 10s, only 1 run was performed.\n\n`rev-dep` circular check is **12 times** faster than the fastest alternative❗\n\n| Tool | Version | Command to Run Circular Check | Time |\n|------|---------|-------------------------------|------|\n| 🥇 [rev-dep](https://github.com/jayu/rev-dep) | 2.0.0 | `rev-dep circular` | 397 ms |\n| 🥈 [dpdm-fast](https://github.com/SunSince90/dpdm-fast) | 1.0.14 | `dpdm --no-tree --no-progress  --no-warning` + list of directories with source code  | 4960 ms |\n| 🥉 [dpdm](https://github.com/acrazing/dpdm) | 3.14.0 | `dpdm  --no-warning` + list of directories with source code | 5030 ms |\n| [skott](https://github.com/antoine-coulon/skott) | 0.35.6 | node script using skott `findCircularDependencies` function  | 29575 ms |\n| [madge](https://github.com/pahen/madge) | 8.0.0 | `madge --circular --extensions js,ts,jsx,tsx .` | 69328 ms |\n| [circular-dependency-scanner](https://github.com/emosheeep/circular-dependency-scanner) | 2.3.0 | `ds` - out of memory error | n/a |\n\n\n\n### **How to detect dev dependencies used in production code**\n\n```\nrev-dep config run\n```\n\nWhen `devDepsUsageOnProdDetection` is enabled in your config, rev-dep will:\n\n1. Trace dependency graphs from your specified production entry points\n2. Identify all files reachable from those entry points\n3. Check if any imported modules are listed in `devDependencies` in package.json\n4. Report violations showing which dev dependencies are used where\n\n**Example Output:**\n```\n❌ Restricted Dev Dependencies Usage Issues (2):\n  lodash (dev dependency)\n     - src/components/Button.tsx (from entry point: src/pages/index.tsx)\n     - src/utils/helpers.ts (from entry point: src/pages/index.tsx)\n  eslint (dev dependency)\n     - src/config/eslint-config.js (from entry point: src/server.ts)\n```\n\n**Important Notes:**\n- Type-only imports (e.g., `import type { ReactNode } from 'react'`) are ignored when `ignoreTypeImports` is enabled\n- Only dependencies from `devDependencies` in package.json are flagged\n- Production dependencies from `dependencies` are allowed\n- Helps prevent runtime failures in production builds\n\n## CLI reference 📖\n\n\u003c!-- cli-docs-start --\u003e\n\n### rev-dep circular\n\nDetect circular dependencies in your project\n\n#### Synopsis\n\nAnalyzes the project to find circular dependencies between modules.\nCircular dependencies can cause hard-to-debug issues and should generally be avoided.\n\n```\nrev-dep circular [flags]\n```\n\n#### Examples\n\n```\nrev-dep circular --ignore-types-imports\n```\n\n#### Options\n\n```\n      --condition-names strings                                     List of conditions for package.json imports resolution (e.g. node, imports, default)\n  -c, --cwd string                                                  Working directory for the command (default \"$PWD\")\n      --follow-monorepo-packages strings                            Enable resolution of imports from monorepo workspace packages. Pass without value to follow all, or pass package names\n  -h, --help                                                        help for circular\n  -t, --ignore-type-imports                                         Exclude type imports from the analysis\n      --package-json string                                         Path to package.json (default: ./package.json)\n      --tsconfig-json string                                        Path to tsconfig.json (default: ./tsconfig.json)\n  -v, --verbose                                                     Show warnings and verbose output\n```\n\n\n### rev-dep config\n\nCreate and execute rev-dep configuration files\n\n#### Synopsis\n\nCommands for creating and executing rev-dep configuration files.\n\n#### Options\n\n```\n  -c, --cwd string   Working directory (default \"$PWD\")\n  -h, --help         help for config\n```\n\n\n### rev-dep config run\n\nExecute all checks defined in (.)rev-dep.config.json(c)\n\n#### Synopsis\n\nProcess (.)rev-dep.config.json(c) and execute all enabled checks (circular imports, orphan files, module boundaries, import conventions, node modules, unused exports, unresolved imports, restricted imports and restricted dev deps usage) per rule.\n\n```\nrev-dep config run [flags]\n```\n\n#### Options\n\n```\n      --condition-names strings                                     List of conditions for package.json imports resolution (e.g. node, imports, default)\n  -c, --cwd string                                                  Working directory (default \"$PWD\")\n      --fix                                                         Automatically fix fixable issues\n      --follow-monorepo-packages strings                            Enable resolution of imports from monorepo workspace packages. Pass without value to follow all, or pass package names\n      --format string                                               Output format (json, issues-list)\n  -h, --help                                                        help for run\n      --list-all-issues                                             List all issues instead of limiting output\n      --package-json string                                         Path to package.json (default: ./package.json)\n      --rules strings                                               Subset of rules to run (comma-separated list of rule paths)\n      --tsconfig-json string                                        Path to tsconfig.json (default: ./tsconfig.json)\n  -v, --verbose                                                     Show warnings and verbose output\n```\n\n\n### rev-dep config init\n\nInitialize a new rev-dep.config.json file\n\n#### Synopsis\n\nCreate a new rev-dep.config.json configuration file in the current directory with default settings.\n\n```\nrev-dep config init [flags]\n```\n\n#### Options\n\n```\n  -c, --cwd string   Working directory (default \"$PWD\")\n  -h, --help         help for init\n```\n\n\n### rev-dep entry-points\n\nDiscover and list all entry points in the project\n\n#### Synopsis\n\nAnalyzes the project structure to identify all potential entry points.\nUseful for understanding your application's architecture and dependencies.\n\n```\nrev-dep entry-points [flags]\n```\n\n#### Examples\n\n```\nrev-dep entry-points --print-deps-count\n```\n\n#### Options\n\n```\n      --condition-names strings                                     List of conditions for package.json imports resolution (e.g. node, imports, default)\n  -n, --count                                                       Only display the number of entry points found\n  -c, --cwd string                                                  Working directory for the command (default \"$PWD\")\n      --follow-monorepo-packages strings                            Enable resolution of imports from monorepo workspace packages. Pass without value to follow all, or pass package names\n      --graph-exclude strings                                       Exclude files matching these glob patterns from analysis\n  -h, --help                                                        help for entry-points\n  -t, --ignore-type-imports                                         Exclude type imports from the analysis\n      --package-json string                                         Path to package.json (default: ./package.json)\n      --print-deps-count                                            Show the number of dependencies for each entry point\n      --result-exclude strings                                      Exclude files matching these glob patterns from results\n      --result-include strings                                      Only include files matching these glob patterns in results\n      --tsconfig-json string                                        Path to tsconfig.json (default: ./tsconfig.json)\n  -v, --verbose                                                     Show warnings and verbose output\n```\n\n\n### rev-dep files\n\nList all files in the dependency tree of an entry point\n\n#### Synopsis\n\nRecursively finds and lists all files that are required\nby the specified entry point.\n\n```\nrev-dep files [flags]\n```\n\n#### Examples\n\n```\nrev-dep files --entry-point src/index.ts\n```\n\n#### Options\n\n```\n      --condition-names strings                                     List of conditions for package.json imports resolution (e.g. node, imports, default)\n  -n, --count                                                       Only display the count of files in the dependency tree\n  -c, --cwd string                                                  Working directory for the command (default \"$PWD\")\n  -p, --entry-point string                                          Entry point file to analyze (required)\n      --follow-monorepo-packages strings                            Enable resolution of imports from monorepo workspace packages. Pass without value to follow all, or pass package names\n  -h, --help                                                        help for files\n  -t, --ignore-type-imports                                         Exclude type imports from the analysis\n      --package-json string                                         Path to package.json (default: ./package.json)\n      --tsconfig-json string                                        Path to tsconfig.json (default: ./tsconfig.json)\n  -v, --verbose                                                     Show warnings and verbose output\n```\n\n\n### rev-dep imported-by\n\nList all files that directly import the specified file\n\n#### Synopsis\n\nFinds and lists all files in the project that directly import the specified file.\nThis is useful for understanding the impact of changes to a particular file.\n\n```\nrev-dep imported-by [flags]\n```\n\n#### Examples\n\n```\nrev-dep imported-by --file src/utils/helpers.ts\n```\n\n#### Options\n\n```\n      --condition-names strings                                     List of conditions for package.json imports resolution (e.g. node, imports, default)\n  -n, --count                                                       Only display the count of importing files\n  -c, --cwd string                                                  Working directory for the command (default \"$PWD\")\n  -f, --file string                                                 Target file to find importers for (required)\n      --follow-monorepo-packages strings                            Enable resolution of imports from monorepo workspace packages. Pass without value to follow all, or pass package names\n  -h, --help                                                        help for imported-by\n      --list-imports                                                List the import identifiers used by each file\n      --package-json string                                         Path to package.json (default: ./package.json)\n      --tsconfig-json string                                        Path to tsconfig.json (default: ./tsconfig.json)\n  -v, --verbose                                                     Show warnings and verbose output\n```\n\n\n### rev-dep lines-of-code\n\nCount actual lines of code in the project excluding comments and blank lines\n\n```\nrev-dep lines-of-code [flags]\n```\n\n#### Examples\n\n```\nrev-dep lines-of-code\n```\n\n#### Options\n\n```\n  -c, --cwd string   Directory to analyze (default \"$PWD\")\n  -h, --help         help for lines-of-code\n```\n\n\n### rev-dep list-cwd-files\n\nList all files in the current working directory\n\n#### Synopsis\n\nRecursively lists all files in the specified directory,\nwith options to filter results.\n\n```\nrev-dep list-cwd-files [flags]\n```\n\n#### Examples\n\n```\nrev-dep list-cwd-files --include='*.ts' --exclude='*.test.ts'\n```\n\n#### Options\n\n```\n      --count             Only display the count of matching files\n      --cwd string        Directory to list files from (default \"$PWD\")\n      --exclude strings   Exclude files matching these glob patterns\n  -h, --help              help for list-cwd-files\n      --include strings   Only include files matching these glob patterns\n```\n\n\n### rev-dep unresolved\n\nList unresolved imports in the project\n\n#### Synopsis\n\nDetect and list imports that could not be resolved during imports resolution. Groups imports by file.\n\n```\nrev-dep unresolved [flags]\n```\n\n#### Options\n\n```\n      --condition-names strings                                     List of conditions for package.json imports resolution (e.g. node, imports, default)\n      --custom-asset-extensions strings                             Additional asset extensions treated as resolvable (e.g. glb,mp3)\n  -c, --cwd string                                                  Working directory for the command (default \"$PWD\")\n      --follow-monorepo-packages strings                            Enable resolution of imports from monorepo workspace packages. Pass without value to follow all, or pass package names\n  -h, --help                                                        help for unresolved\n      --ignore stringToString                                       Map of file path (relative to cwd) to exact import request to ignore (e.g. --ignore src/index.ts=some-module) (default [])\n      --ignore-files strings                                        File path glob patterns to ignore in unresolved output\n      --ignore-imports strings                                      Import requests to ignore globally in unresolved output\n      --package-json string                                         Path to package.json (default: ./package.json)\n      --tsconfig-json string                                        Path to tsconfig.json (default: ./tsconfig.json)\n  -v, --verbose                                                     Show warnings and verbose output\n```\n\n\n### rev-dep node-modules\n\nAnalyze and manage Node.js dependencies\n\n#### Synopsis\n\nTools for analyzing and managing Node.js module dependencies.\nHelps identify unused, missing, or duplicate dependencies in your project.\n\n#### Examples\n\n```\n  rev-dep node-modules used -p src/index.ts\n  rev-dep node-modules unused --exclude-modules=@types/*\n  rev-dep node-modules missing --entry-points=src/main.ts\n```\n\n#### Options\n\n```\n  -h, --help   help for node-modules\n```\n\n\n### rev-dep node-modules dirs-size\n\nCalculates cumulative files size in node_modules directories\n\n#### Synopsis\n\nCalculates and displays the size of node_modules folders\nin the current directory and subdirectories. Sizes will be smaller than actual file size taken on disk. Tool is calculating actual file size rather than file size on disk (related to disk blocks usage)\n\n```\nrev-dep node-modules dirs-size [flags]\n```\n\n#### Examples\n\n```\nrev-dep node-modules dirs-size\n```\n\n#### Options\n\n```\n  -c, --cwd string   Working directory for the command (default \"$PWD\")\n  -h, --help         help for dirs-size\n```\n\n\n### rev-dep node-modules installed-duplicates\n\nFind and optimize duplicate package installations\n\n#### Synopsis\n\nIdentifies packages that are installed multiple times in node_modules.\nCan optimize storage by creating symlinks between duplicate packages.\n\n```\nrev-dep node-modules installed-duplicates [flags]\n```\n\n#### Examples\n\n```\nrev-dep node-modules installed-duplicates --optimize --size-stats\n```\n\n#### Options\n\n```\n  -c, --cwd string   Working directory for the command (default \"$PWD\")\n  -h, --help         help for installed-duplicates\n      --isolate      Create symlinks only within the same top-level node_module directories. By default optimize creates symlinks between top-level node_module directories (eg. when workspaces are used). Needs --optimize flag to take effect\n      --optimize     Automatically create symlinks to deduplicate packages\n      --size-stats   Print node modules dirs size before and after optimization. Might take longer than optimization itself\n      --verbose      Show detailed information about each optimization\n```\n\n\n### rev-dep node-modules installed\n\nList all installed npm packages in the project\n\n#### Synopsis\n\nRecursively scans node_modules directories to list all installed packages.\nHelpful for auditing dependencies across monorepos.\n\n```\nrev-dep node-modules installed [flags]\n```\n\n#### Examples\n\n```\nrev-dep node-modules installed --include-modules=@myorg/*\n```\n\n#### Options\n\n```\n  -c, --cwd string                Working directory for the command (default \"$PWD\")\n  -e, --exclude-modules strings   list of modules to exclude from the output\n  -h, --help                      help for installed\n  -i, --include-modules strings   list of modules to include in the output\n```\n\n\n### rev-dep node-modules missing\n\nFind imported packages not listed in package.json\n\n#### Synopsis\n\nIdentifies packages that are imported in your code but not declared\nin your package.json dependencies.\n\n```\nrev-dep node-modules missing [flags]\n```\n\n#### Examples\n\n```\nrev-dep node-modules missing --entry-points=src/main.ts\n```\n\n#### Options\n\n```\n      --condition-names strings                                     List of conditions for package.json imports resolution (e.g. node, imports, default)\n  -n, --count                                                       Only display the count of modules\n  -c, --cwd string                                                  Working directory for the command (default \"$PWD\")\n  -p, --entry-points strings                                        Entry point file(s) to start analysis from (default: auto-detected)\n  -e, --exclude-modules strings                                     list of modules to exclude from the output\n  -b, --files-with-binaries strings                                 Additional files to search for binary usages. Use paths relative to cwd\n  -m, --files-with-node-modules strings                             Additional files to search for module imports. Use paths relative to cwd\n      --follow-monorepo-packages strings                            Enable resolution of imports from monorepo workspace packages. Pass without value to follow all, or pass package names\n      --group-by-file                                               Organize output by project file path\n      --group-by-module                                             Organize output by npm package name\n      --group-by-module-files-count                                 Organize output by npm package name and show count of files using it\n  -h, --help                                                        help for missing\n  -t, --ignore-type-imports                                         Exclude type imports from the analysis\n  -i, --include-modules strings                                     list of modules to include in the output\n      --package-json string                                         Path to package.json (default: ./package.json)\n      --pkg-fields-with-binaries strings                            Additional package.json fields to check for binary usages\n      --tsconfig-json string                                        Path to tsconfig.json (default: ./tsconfig.json)\n  -v, --verbose                                                     Show warnings and verbose output\n      --zero-exit-code                                              Use this flag to always return zero exit code\n```\n\n\n### rev-dep node-modules unused\n\nFind installed packages that aren't imported in your code\n\n#### Synopsis\n\nCompares package.json dependencies with actual imports in your codebase\nto identify potentially unused packages.\n\n```\nrev-dep node-modules unused [flags]\n```\n\n#### Examples\n\n```\nrev-dep node-modules unused --exclude-modules=@types/*\n```\n\n#### Options\n\n```\n      --condition-names strings                                     List of conditions for package.json imports resolution (e.g. node, imports, default)\n  -n, --count                                                       Only display the count of modules\n  -c, --cwd string                                                  Working directory for the command (default \"$PWD\")\n  -p, --entry-points strings                                        Entry point file(s) to start analysis from (default: auto-detected)\n  -e, --exclude-modules strings                                     list of modules to exclude from the output\n  -b, --files-with-binaries strings                                 Additional files to search for binary usages. Use paths relative to cwd\n  -m, --files-with-node-modules strings                             Additional files to search for module imports. Use paths relative to cwd\n      --follow-monorepo-packages strings                            Enable resolution of imports from monorepo workspace packages. Pass without value to follow all, or pass package names\n  -h, --help                                                        help for unused\n  -t, --ignore-type-imports                                         Exclude type imports from the analysis\n  -i, --include-modules strings                                     list of modules to include in the output\n      --package-json string                                         Path to package.json (default: ./package.json)\n      --pkg-fields-with-binaries strings                            Additional package.json fields to check for binary usages\n      --tsconfig-json string                                        Path to tsconfig.json (default: ./tsconfig.json)\n  -v, --verbose                                                     Show warnings and verbose output\n      --zero-exit-code                                              Use this flag to always return zero exit code\n```\n\n\n### rev-dep node-modules used\n\nList all npm packages imported in your code\n\n#### Synopsis\n\nAnalyzes your code to identify which npm packages are actually being used.\nHelps keep track of your project's runtime dependencies.\n\n```\nrev-dep node-modules used [flags]\n```\n\n#### Examples\n\n```\nrev-dep node-modules used -p src/index.ts --group-by-module\n```\n\n#### Options\n\n```\n      --condition-names strings                                     List of conditions for package.json imports resolution (e.g. node, imports, default)\n  -n, --count                                                       Only display the count of modules\n  -c, --cwd string                                                  Working directory for the command (default \"$PWD\")\n  -p, --entry-points strings                                        Entry point file(s) to start analysis from (default: auto-detected)\n  -e, --exclude-modules strings                                     list of modules to exclude from the output\n  -b, --files-with-binaries strings                                 Additional files to search for binary usages. Use paths relative to cwd\n  -m, --files-with-node-modules strings                             Additional files to search for module imports. Use paths relative to cwd\n      --follow-monorepo-packages strings                            Enable resolution of imports from monorepo workspace packages. Pass without value to follow all, or pass package names\n      --group-by-entry-point                                        Organize output by entry point file path\n      --group-by-entry-point-modules-count                          Organize output by entry point and show count of unique modules\n      --group-by-file                                               Organize output by project file path\n      --group-by-module                                             Organize output by npm package name\n      --group-by-module-entry-points-count                          Organize output by npm package name and show count of entry points using it\n      --group-by-module-files-count                                 Organize output by npm package name and show count of files using it\n      --group-by-module-show-entry-points                           Organize output by npm package name and list entry points using it\n  -h, --help                                                        help for used\n  -t, --ignore-type-imports                                         Exclude type imports from the analysis\n  -i, --include-modules strings                                     list of modules to include in the output\n      --package-json string                                         Path to package.json (default: ./package.json)\n      --pkg-fields-with-binaries strings                            Additional package.json fields to check for binary usages\n      --tsconfig-json string                                        Path to tsconfig.json (default: ./tsconfig.json)\n  -v, --verbose                                                     Show warnings and verbose output\n```\n\n\n### rev-dep resolve\n\nTrace and display the dependency path between files in your project\n\n#### Synopsis\n\nAnalyze and display the dependency chain between specified files.\nHelps understand how different parts of your codebase are connected.\n\n```\nrev-dep resolve [flags]\n```\n\n#### Examples\n\n```\nrev-dep resolve -p src/index.ts -f src/utils/helpers.ts\n```\n\n#### Options\n\n```\n  -a, --all                                                         Show all possible resolution paths, not just the first one\n      --compact-summary                                             Display a compact summary of found paths\n      --condition-names strings                                     List of conditions for package.json imports resolution (e.g. node, imports, default)\n  -c, --cwd string                                                  Working directory for the command (default \"$PWD\")\n  -p, --entry-points strings                                        Entry point file(s) or glob pattern(s) to start analysis from (default: auto-detected)\n  -f, --file string                                                 Target file to check for dependencies\n      --follow-monorepo-packages strings                            Enable resolution of imports from monorepo workspace packages. Pass without value to follow all, or pass package names\n      --graph-exclude strings                                       Glob patterns to exclude files from dependency analysis\n  -h, --help                                                        help for resolve\n  -t, --ignore-type-imports                                         Exclude type imports from the analysis\n      --module string                                               Target node module name to check for dependencies\n      --package-json string                                         Path to package.json (default: ./package.json)\n      --tsconfig-json string                                        Path to tsconfig.json (default: ./tsconfig.json)\n  -v, --verbose                                                     Show warnings and verbose output\n```\n\n\n\n\u003c!-- cli-docs-end --\u003e\n\n\n## Glossary 📚\n\nSome of the terms used in the problem space that **rev-dep** covers can be confusing.\nHere is a small glossary to help you navigate the concepts.\n\n### Dependency\n\nA *dependency* can be understood literally. In the context of a project’s dependency graph, it may refer to:\n\n* a **node module / package** (a package is a dependency of a project or file), or\n* a **source code file** (a file is a dependency of another file if it imports it).\n\n### Entry point\n\nAn *entry point* is a source file that is **not imported by any other file**.\nIt can represent:\n\n* the main entry of the application\n* an individual page or feature\n* configuration or test bootstrap files\n\n— depending on the project structure.\n\n### Unused / Dead file\n\nA file is considered *unused* or *dead* when:\n\n* it is an **entry point** (nothing imports it), **and**\n* running it does **not produce any meaningful output** or side effect.\n\nIn practice, such files can often be removed safely.\n\n### Circular dependency\n\nA *circular dependency* occurs when a file **directly or indirectly imports itself** through a chain of imports.\n\nThis can lead to unpredictable runtime behavior, uninitialized values, or subtle bugs.\nHowever, circular dependencies between **TypeScript type-only imports** are usually harmless.\n\n### Reverse dependency (or \"dependents\")\n\nFiles that *import* a given file.\nUseful for answering: \"What breaks if I change or delete this file?\"\n\n### Import graph / Dependency graph\n\nA visual representation of how files or modules import each other.\n\n### Missing dependency / unused node module\n\nA module that your code imports but is **not listed in package.json**.\n\n### Unused dependency / unused node module\n\nA dependency listed in **package.json** that is **never imported** in the source code.\n\n### Root directory / Project root\n\nThe top-level directory used as the starting point for dependency analysis.\n\n## Made in 🇵🇱 and 🇯🇵 with 🧠 by [@jayu](https://github.com/jayu)\n\nI hope that this small piece of software will help you discover and understood complexity of your project hence make you more confident while refactoring. If this tool was useful, don't hesitate to give it a ⭐!\n","funding_links":[],"categories":["Multiple languages","Tools"],"sub_categories":["IDE"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjayu%2Frev-dep","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjayu%2Frev-dep","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjayu%2Frev-dep/lists"}