dependency-cruiser vs Rev-dep
dependency-cruiser validates dependencies against custom forbidden rules and draws dependency graphs. rev-dep covers the same validation with purpose-built checks and runs faster - but dependency-cruiser is also a graph visualizer, which rev-dep is not.
At a glance​
| dependency-cruiser | Rev-dep | |
|---|---|---|
| Primary focus | dependency rules + visualization | dependency hygiene + architecture |
| Runtime | Node | Go - single parallel pass (faster) |
| Circular / orphan detection | yes | yes |
| Path-to-path forbidden rules | yes (generic from/to) | yes (boundaries + restricted imports) |
| Unused / missing dependencies | partial | yes |
| Unused exports | no | yes |
| Graph visualization (dot/mermaid/HTML) | yes | no |
| Config | .dependency-cruiser.js (regex rules) | rev-dep.config.jsonc (named checks, globs) |
Where rev-dep is stronger​
- Named checks instead of hand-written rules. Boundaries, restricted imports, circular, and orphan files are dedicated detectors rather than generic
from/torules. - Broader hygiene - it also detects unused/missing dependencies and unused exports.
- Speed across large monorepos.
Where dependency-cruiser may still fit​
Its headline feature is visualization - rendering the graph as SVG, mermaid, or HTML. rev-dep answers reachability as text via the exploratory toolkit but produces no images. If you rely on the diagrams, keep dependency-cruiser for that.
Which should you choose?​
- Need dependency-graph diagrams? dependency-cruiser (optionally alongside rev-dep for the checks).
- Want fast, named architecture checks plus unused-code/dependency detection in one config? rev-dep.
Migrating​
See Migrating from dependency-cruiser to translate your forbidden rules into rev-dep checks.