# Rev-dep - High-Speed Dependency Graph Analysis for JavaScript and TypeScript Monorepos > Enforce module boundaries, find circular imports, dead files, unused exports, and dependency issues in one fast CLI. Audit 500k+ LoC in around 150ms. These are the docs for rev-dep 3.x, a Go CLI distributed on npm that analyzes the dependency graph of JavaScript/TypeScript projects and monorepos. It is used in two ways: config-based checks declared in `rev-dep.config.json(c)` and run with `rev-dep config run` (add `--format json` for machine-readable output; exit code 0 means every check passed, 1 means issues were found), and exploratory commands that need no config, such as `imported-by`, `resolve`, `files`, `entry-points`, `circular`, `duplicated-code` and `node-modules`. Pages are listed in sidebar order, and each link points to a Markdown version of the page. ## Table of Contents - [Overview](https://rev-dep.com/docs/intro.md): Learn about Rev-dep, a high-speed static analysis tool written in Go for enforcing architecture integrity and dependency hygiene in large-scale JS/... - [Installation and Quick Start](https://rev-dep.com/docs/installation.md): Quickly install and set up rev-dep in your JS/TS project using pnpm, npm, or yarn, and learn how to initialize your configuration. - [Monorepo integration guide](https://rev-dep.com/docs/monorepo-integration-guide.md): Step-by-step guide to integrating rev-dep into a monorepo - generate a config, verify resolution, define entry points, and enable each check in a s... - [Single workspace integration guide](https://rev-dep.com/docs/single-workspace-integration-guide.md): Step-by-step guide to integrating rev-dep into a single-package project - generate a config, verify resolution, define entry points, and enable eac... - [Overview](https://rev-dep.com/docs/config-based-checks/overview.md): An overview of rev-dep config-based checks, highlighting high performance and the ability to run multiple detectors in a single, parallelized pass. - [Config file structure](https://rev-dep.com/docs/config-based-checks/config-file-structure.md): Understand the structure of the rev-dep configuration file, including top-level fields, workspace-level fields, and how to define various project c... - [Entry points definition](https://rev-dep.com/docs/config-based-checks/entry-points-definition.md): Learn how to define production and development entry points in rev-dep to ensure accurate dependency analysis and dead code detection. - [Enforcing Module Boundaries in Monorepos](https://rev-dep.com/docs/config-based-checks/checks/module-boundaries.md): Enforce architectural constraints and dependency boundaries in monorepos by preventing files in certain directories from importing files in forbidd... - [Forbidden or Restricted Imports](https://rev-dep.com/docs/config-based-checks/checks/restricted-imports.md): Prevent the accidental import of restricted modules or files, such as preventing server-side code from leaking into client-side bundles. - [Restricted Importers](https://rev-dep.com/docs/config-based-checks/checks/restricted-importers.md): Constrain which entry points may transitively reach a set of files or node modules - the reverse of restricted imports. Useful for keeping new code... - [Restricted Direct Importers](https://rev-dep.com/docs/config-based-checks/checks/restricted-direct-importers.md): Constrain which files may directly import a set of files or node modules. A non-transitive, graph-free check - the direct-edge counterpart of restr... - [Consistent Import Conventions](https://rev-dep.com/docs/config-based-checks/checks/import-conventions.md): Enforce consistent import styles (like relative vs. absolute imports) across your codebase to maintain clear domain boundaries and improve readabil... - [Circular Dependency Detection](https://rev-dep.com/docs/config-based-checks/checks/circular-imports.md): Detect and prevent dependency cycles (circular imports) between files, ensuring a clean and maintainable dependency graph. - [Duplicated Code Detection](https://rev-dep.com/docs/config-based-checks/checks/duplicated-code.md): Detect copy-pasted code across a project or monorepo - repeated code blocks and JSX elements that can be extracted into shared implementations. - [Find Unused or Unreachable Files](https://rev-dep.com/docs/config-based-checks/checks/orphan-files.md): Detect and remove files that are not reachable from your project's entry points, helping to clean up dead code and reduce codebase complexity. - [Find Unused Exports](https://rev-dep.com/docs/config-based-checks/checks/unused-exports.md): Detect and remove exports that are not reachable from any project entry points, helping to clean up dead code and reduce bundle size. - [Find Unused Node Modules](https://rev-dep.com/docs/config-based-checks/checks/unused-node-modules.md): Detect unused dependencies from your `package.json` to reduce bundle size, improve maintainability, and speed up installations. - [Find Undeclared Dependencies](https://rev-dep.com/docs/config-based-checks/checks/missing-node-modules.md): Detect imports of packages that are missing from your `package.json` to prevent runtime failures and broken builds in CI/CD or production. - [Dev Dependencies in Production](https://rev-dep.com/docs/config-based-checks/checks/dev-deps-on-prod.md): Detect when packages listed in `devDependencies` are imported by production code, preventing runtime failures and deployment errors. - [Find Unresolved or Broken Imports](https://rev-dep.com/docs/config-based-checks/checks/unresolved-imports.md): Detect import statements that cannot be resolved to a physical file or module, helping to prevent runtime errors and build failures. - [Running checks and autofix](https://rev-dep.com/docs/config-based-checks/running-checks-and-autofix.md): Learn how to run rev-dep checks, use different output formats, and utilize the powerful autofix feature to automatically resolve dependency and imp... - [Findings baseline](https://rev-dep.com/docs/config-based-checks/findings-baseline.md): Acknowledge existing findings, keep CI clean, and detect new or obsolete issues without depending on source positions or detector-array order. - [Linting the config](https://rev-dep.com/docs/config-based-checks/linting-the-config.md): Lint your rev-dep config for dead glob patterns, overlaps, and redundant syntax - and auto-fix them while preserving comments and formatting. - [Output formats](https://rev-dep.com/docs/config-based-checks/output-formats.md): Explore the different output formats available in rev-dep cli, including human-readable, JSON, and issues-list formats for local use and CI integra... - [Troubleshooting](https://rev-dep.com/docs/troubleshooting.md): Index of rev-dep troubleshooting guides, plus the related concepts and features they build on. - [Unresolved imports troubleshooting](https://rev-dep.com/docs/troubleshooting/unresolved-imports-troubleshooting.md): Why rev-dep reports unresolved imports - missing files, unsupported aliases, condition names, asset extensions, gitignore, monorepo following, and ... - [Missing or unused dependency false positives](https://rev-dep.com/docs/troubleshooting/missing-or-unused-dependency-false-positives.md): Why rev-dep reports missing or unused node modules in monorepos, and how to fix it - declare each dependency in the package that compiles the code. - [Orphan files and unused exports in shared packages](https://rev-dep.com/docs/troubleshooting/orphan-files-and-unused-exports-in-shared-packages.md): Why unused exports - but not orphan files - leak from shared packages into a compiled app's report, and the two setups that fix it: root-level dete... - [Overview](https://rev-dep.com/docs/exploratory-toolkit/overview.md): Overview of the rev-dep exploratory CLI commands for answering one-off dependency questions without writing a config file. - [Find entry points](https://rev-dep.com/docs/exploratory-toolkit/entry-points.md): Discover project entry points with rev-dep - files not imported by any other file - to bootstrap config or understand application roots. - [Inspect dependency tree](https://rev-dep.com/docs/exploratory-toolkit/files.md): List every file reachable from an entry point with rev-dep files to understand bundle scope and why a file is considered reachable. - [Trace direct importers](https://rev-dep.com/docs/exploratory-toolkit/imported-by.md): Find the direct importers of a file with rev-dep imported-by for fast, local impact analysis before changing or moving a module. - [Resolve dependency path](https://rev-dep.com/docs/exploratory-toolkit/resolve.md): Trace dependency paths from entry points to a file or package with rev-dep resolve to explain unexpected reachability. - [Detect circular dependencies](https://rev-dep.com/docs/exploratory-toolkit/circular.md): Detect circular dependencies with rev-dep circular, with a non-zero exit code for lightweight CI use. - [Find duplicated code](https://rev-dep.com/docs/exploratory-toolkit/duplicated-code.md): Find copy-pasted code with rev-dep duplicated-code - repeated code blocks and JSX elements, printed with their locations and source. - [Inspect node modules usage](https://rev-dep.com/docs/exploratory-toolkit/node-modules.md): Inspect npm package usage with rev-dep node-modules - used, unused, missing, and installed packages - plus node_modules maintenance commands. - [Count lines of code](https://rev-dep.com/docs/exploratory-toolkit/lines-of-code.md): Count effective lines of code with rev-dep lines-of-code, excluding comments, blank lines, and tagged template strings. - [Debug commands](https://rev-dep.com/docs/exploratory-toolkit/debug.md): Inspect rev-dep internals with the debug commands - parsed imports, the resolved dependency tree, tsconfig aliases, and discovered files. - [Common investigative workflows](https://rev-dep.com/docs/exploratory-toolkit/workflows.md): Practical recipes that chain rev-dep exploratory commands to investigate reachability, package hygiene, and config entry points. - [How duplicated code detection works](https://rev-dep.com/docs/other-concepts-and-features/duplicated-code-detection.md): How rev-dep detects duplicated code - why it reports repeated blocks and JSX elements rather than repeated lines, and what that changes about the f... - [Following monorepo packages](https://rev-dep.com/docs/other-concepts-and-features/following-monorepo-packages.md): Control whether rev-dep traces from one workspace package into another package's source with followMonorepoPackages - all, none, or selected packages. - [Node modules resolution](https://rev-dep.com/docs/other-concepts-and-features/node-modules-resolution.md): How rev-dep decides which package.json each third-party (node module) import is validated against - entry-package vs nearest-package - plus the inc... - [Built-in modules](https://rev-dep.com/docs/other-concepts-and-features/built-in-modules.md): Which imports rev-dep treats as built-in modules of Node.js, Deno and Bun, how to restrict them with builtin:* or by name, and what happens where t... - [Ignoring files](https://rev-dep.com/docs/other-concepts-and-features/ignoring-files.md): Understand the levels at which rev-dep ignores files - gitignore, ignoreFiles, processIgnoredFiles, detector graphExclude, and per-detector ignore ... - [Glob patterns](https://rev-dep.com/docs/other-concepts-and-features/glob-patterns.md): How file-path glob patterns are matched in rev-dep - gitignore-style behavior - and how to escape special characters such as the square brackets in... - [Module resolution and path aliases](https://rev-dep.com/docs/other-concepts-and-features/module-resolution-and-path-aliases.md): How rev-dep resolves imports - tsconfig path aliases and package.json imports/exports maps with condition names - and the limits to be aware of. - [Supported file types](https://rev-dep.com/docs/other-concepts-and-features/supported-file-types.md): Which file types rev-dep parses, how asset imports are recognized, and how to extend the recognized asset extensions via config. - [Svelte support](https://rev-dep.com/docs/other-concepts-and-features/svelte-support.md): How rev-dep handles Svelte .svelte components - parses imports from the script blocks with standard module resolution and a little Svelte-aware han... - [Vue support](https://rev-dep.com/docs/other-concepts-and-features/vue-support.md): How rev-dep handles Vue .vue single-file components - basic support that parses imports from the script block using standard module resolution. - [Migrating from other tools](https://rev-dep.com/docs/migrating-from-other-tools/overview.md): Migrate to rev-dep from knip, dependency-cruiser, depcheck, madge, dpdm, ts-prune, ts-unused-exports, unimported, skott, eslint-plugin-import, good... - [Migrating from knip](https://rev-dep.com/docs/migrating-from-other-tools/migrating-from-knip.md): Migrate from knip to rev-dep, measured up to 20x faster: map unused files, exports, dependencies and unlisted/unresolved imports onto rev-dep check... - [Migrating from dependency-cruiser](https://rev-dep.com/docs/migrating-from-other-tools/migrating-from-dependency-cruiser.md): Migrate from dependency-cruiser to rev-dep, measured up to 65x faster: map forbidden-dependency rules, circular and orphan detection onto rev-dep's... - [Migrating from depcheck](https://rev-dep.com/docs/migrating-from-other-tools/migrating-from-depcheck.md): Migrate from depcheck to rev-dep: map unused and missing dependency detection onto rev-dep's node-modules checks in a single fast pass. - [Migrating from madge](https://rev-dep.com/docs/migrating-from-other-tools/migrating-from-madge.md): Migrate from madge to rev-dep, measured up to 92x faster: replace circular-dependency and orphan detection with a config-driven suite (note: rev-de... - [Migrating from dpdm](https://rev-dep.com/docs/migrating-from-other-tools/migrating-from-dpdm.md): Migrate from dpdm to rev-dep, measured up to 43x faster: replace circular-dependency and unused-file detection with a config-driven suite of checks. - [Migrating from ts-prune](https://rev-dep.com/docs/migrating-from-other-tools/migrating-from-ts-prune.md): Migrate from ts-prune to rev-dep: replace unused-export detection and gain whole-graph architecture checks in a single fast pass. - [Migrating from ts-unused-exports](https://rev-dep.com/docs/migrating-from-other-tools/migrating-from-ts-unused-exports.md): Migrate from ts-unused-exports to rev-dep: map unused-export detection (and completely-unused files) onto rev-dep checks in one fast pass. - [Migrating from unimported](https://rev-dep.com/docs/migrating-from-other-tools/migrating-from-unimported.md): Migrate from unimported to rev-dep: map unused files, unused dependencies and unresolved imports onto rev-dep's checks in a single fast pass. - [Migrating from skott](https://rev-dep.com/docs/migrating-from-other-tools/migrating-from-skott.md): Migrate from skott to rev-dep, measured up to 400x faster: replace circular-dependency, unused-file and unused-dependency detection with a config-d... - [Migrating from eslint-plugin-import](https://rev-dep.com/docs/migrating-from-other-tools/migrating-from-eslint-plugin-import.md): Migrate import-graph ESLint rules (no-cycle, no-unused-modules, no-unresolved, no-extraneous-dependencies, no-restricted-paths) to rev-dep's faster... - [Migrating from good-fences](https://rev-dep.com/docs/migrating-from-other-tools/migrating-from-good-fences.md): Migrate from good-fences to rev-dep: express directory import boundaries as module-boundary and restricted-import checks in one fast pass. - [Migrating from Sheriff](https://rev-dep.com/docs/migrating-from-other-tools/migrating-from-sheriff.md): Migrate from Sheriff (softarc) to rev-dep: express module boundaries and dependency rules as path-pattern checks in one fast pass. - [Migrating from npm-check](https://rev-dep.com/docs/migrating-from-other-tools/migrating-from-npm-check.md): Migrate from npm-check to rev-dep for unused-dependency detection - faster, config-driven, and with missing-dependency and architecture checks added. - [Comparison with other tools](https://rev-dep.com/docs/comparison-with-other-tools/overview.md): JavaScript and TypeScript dependency analysis tools compared: knip, madge, dependency-cruiser, depcheck, jscpd and more - what each checks, which a... - [knip vs Rev-dep](https://rev-dep.com/docs/comparison-with-other-tools/knip-vs-rev-dep.md): knip vs rev-dep: compare unused-code detection, architecture checks and config. rev-dep is a Go-based alternative, measured up to 20x faster, that ... - [dependency-cruiser vs Rev-dep](https://rev-dep.com/docs/comparison-with-other-tools/dependency-cruiser-vs-rev-dep.md): dependency-cruiser vs rev-dep: compare dependency rules, circular and orphan detection, visualization. rev-dep is a config-driven alternative, meas... - [depcheck vs Rev-dep](https://rev-dep.com/docs/comparison-with-other-tools/depcheck-vs-rev-dep.md): depcheck vs rev-dep: compare unused and missing dependency detection, performance and scope. rev-dep is a faster, maintained alternative that cover... - [madge vs Rev-dep](https://rev-dep.com/docs/comparison-with-other-tools/madge-vs-rev-dep.md): madge vs rev-dep: compare circular-dependency detection and graph visualization. rev-dep is an enforceable alternative, measured up to 92x faster (... - [jscpd vs Rev-dep](https://rev-dep.com/docs/comparison-with-other-tools/jscpd-vs-rev-dep.md): jscpd vs rev-dep: compare copy-paste detection for JS/TS - what each reports, renamed and near-miss copies, baselines, and where each fits. jscpd v... - [dpdm vs Rev-dep](https://rev-dep.com/docs/comparison-with-other-tools/dpdm-vs-rev-dep.md): dpdm vs rev-dep: compare circular-dependency and unused-file detection and scope. rev-dep is a config-driven alternative, measured up to 43x faster... - [ts-prune vs Rev-dep](https://rev-dep.com/docs/comparison-with-other-tools/ts-prune-vs-rev-dep.md): ts-prune vs rev-dep: compare unused-export detection, performance and scope. rev-dep is a faster, maintained alternative that also enforces archite... - [ts-unused-exports vs Rev-dep](https://rev-dep.com/docs/comparison-with-other-tools/ts-unused-exports-vs-rev-dep.md): ts-unused-exports vs rev-dep: compare unused-export detection, performance and scope. rev-dep is a faster alternative that also finds orphan files ... - [unimported vs Rev-dep](https://rev-dep.com/docs/comparison-with-other-tools/unimported-vs-rev-dep.md): unimported vs rev-dep: compare unused-file, unused-dependency and unresolved-import detection. rev-dep is a faster, maintained alternative that cov... - [skott vs Rev-dep](https://rev-dep.com/docs/comparison-with-other-tools/skott-vs-rev-dep.md): skott vs rev-dep: compare circular-dependency, unused-file and unused-dependency detection and visualization. rev-dep is a config-driven alternativ... - [eslint-plugin-import vs Rev-dep](https://rev-dep.com/docs/comparison-with-other-tools/eslint-plugin-import-vs-rev-dep.md): eslint-plugin-import vs rev-dep: compare import-graph rules (no-cycle, no-unused-modules, no-restricted-paths) for speed and scope. rev-dep is a fa... - [good-fences vs Rev-dep](https://rev-dep.com/docs/comparison-with-other-tools/good-fences-vs-rev-dep.md): good-fences vs rev-dep: compare directory import boundaries, performance and scope. rev-dep enforces the same boundaries from one central config, p... - [Sheriff vs Rev-dep](https://rev-dep.com/docs/comparison-with-other-tools/sheriff-vs-rev-dep.md): Sheriff vs rev-dep: compare module boundaries, dependency rules and encapsulation. rev-dep enforces boundaries with path patterns and adds a full h... - [npm-check vs Rev-dep](https://rev-dep.com/docs/comparison-with-other-tools/npm-check-vs-rev-dep.md): npm-check vs rev-dep: compare unused-dependency detection and scope. rev-dep is a faster, maintained alternative for dependency hygiene (npm-check ... - [Overview](https://rev-dep.com/docs/cli-reference/overview.md): This section is the exact command reference generated automatically from the CLI implementation. - [rev-dep circular](https://rev-dep.com/docs/cli-reference/generated/rev-dep_circular.md): Detect circular dependencies in your project - [rev-dep config](https://rev-dep.com/docs/cli-reference/generated/rev-dep_config.md): Create and execute rev-dep configuration files - [rev-dep config run](https://rev-dep.com/docs/cli-reference/generated/rev-dep_config_run.md): Execute all checks defined in (.)rev-dep.config.json(c) - [rev-dep config init](https://rev-dep.com/docs/cli-reference/generated/rev-dep_config_init.md): Initialize a new rev-dep.config.json file - [rev-dep config lint](https://rev-dep.com/docs/cli-reference/generated/rev-dep_config_lint.md): Report (and optionally remove) config glob/path patterns that match nothing - [rev-dep config migrate](https://rev-dep.com/docs/cli-reference/generated/rev-dep_config_migrate.md): Upgrade a v2 config to the v3 (2.2) schema - [rev-dep debug](https://rev-dep.com/docs/cli-reference/generated/rev-dep_debug.md): Debugging tools to inspect parser and resolver internals - [rev-dep debug get-tree-for-cwd](https://rev-dep.com/docs/cli-reference/generated/rev-dep_debug_get-tree-for-cwd.md): Debug: Show complete dependency tree for analysis - [rev-dep debug list-cwd-files](https://rev-dep.com/docs/cli-reference/generated/rev-dep_debug_list-cwd-files.md): List all files in the current working directory - [rev-dep debug parse-file](https://rev-dep.com/docs/cli-reference/generated/rev-dep_debug_parse-file.md): Debug: Show parsed imports for a single file - [rev-dep debug parse-tsconfig](https://rev-dep.com/docs/cli-reference/generated/rev-dep_debug_parse-tsconfig.md): Debug: Show parsed TypeScript configuration aliases - [rev-dep duplicated-code](https://rev-dep.com/docs/cli-reference/generated/rev-dep_duplicated-code.md): Find code duplicated across (and within) the files of the project - [rev-dep entry-points](https://rev-dep.com/docs/cli-reference/generated/rev-dep_entry-points.md): Discover and list all entry points in the project - [rev-dep files](https://rev-dep.com/docs/cli-reference/generated/rev-dep_files.md): List all files in the dependency tree of an entry point - [rev-dep imported-by](https://rev-dep.com/docs/cli-reference/generated/rev-dep_imported-by.md): List all files that directly import the specified file - [rev-dep lines-of-code](https://rev-dep.com/docs/cli-reference/generated/rev-dep_lines-of-code.md): Count actual lines of code in the project excluding comments and blank lines - [rev-dep list-cwd-files](https://rev-dep.com/docs/cli-reference/generated/rev-dep_list-cwd-files.md): List all files in the current working directory - [rev-dep unresolved](https://rev-dep.com/docs/cli-reference/generated/rev-dep_unresolved.md): List unresolved imports in the project - [rev-dep node-modules](https://rev-dep.com/docs/cli-reference/generated/rev-dep_node-modules.md): Analyze and manage Node.js dependencies - [rev-dep node-modules analyze-size](https://rev-dep.com/docs/cli-reference/generated/rev-dep_node-modules_analyze-size.md): Analyze disk usage of node_modules - [rev-dep node-modules dirs-size](https://rev-dep.com/docs/cli-reference/generated/rev-dep_node-modules_dirs-size.md): Calculates cumulative files size in node_modules directories - [rev-dep node-modules installed-duplicates](https://rev-dep.com/docs/cli-reference/generated/rev-dep_node-modules_installed-duplicates.md): Find and optimize duplicate package installations - [rev-dep node-modules installed](https://rev-dep.com/docs/cli-reference/generated/rev-dep_node-modules_installed.md): List all installed npm packages in the project - [rev-dep node-modules missing](https://rev-dep.com/docs/cli-reference/generated/rev-dep_node-modules_missing.md): Find imported packages not listed in package.json - [rev-dep node-modules prune-docs](https://rev-dep.com/docs/cli-reference/generated/rev-dep_node-modules_prune-docs.md): Remove markdown/docs-like files from installed node_modules packages - [rev-dep node-modules unused](https://rev-dep.com/docs/cli-reference/generated/rev-dep_node-modules_unused.md): Find installed packages that aren't imported in your code - [rev-dep node-modules used](https://rev-dep.com/docs/cli-reference/generated/rev-dep_node-modules_used.md): List all npm packages imported in your code - [rev-dep resolve](https://rev-dep.com/docs/cli-reference/generated/rev-dep_resolve.md): Trace and display the dependency path between files in your project - [v3 breaking changes](https://rev-dep.com/docs/upgrade-guides/v3-breaking-changes.md): Breaking changes scheduled for rev-dep v3 and how to update your configuration for each one. - [Glossary](https://rev-dep.com/docs/glossary.md): A glossary of key terms used in static analysis problem space, covering concepts like entry points, circular dependencies, and dependency hygiene. - [Telemetry](https://rev-dep.com/docs/telemetry.md): rev-dep collects a single anonymous event during config run to understand how its features are used. It is fully opt-out, never slows the tool, and...