Skip to main content
Version: 3.x

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-cruiserRev-dep
Primary focusdependency rules + visualizationdependency hygiene + architecture
RuntimeNodeGo - single parallel pass (up to 65x faster)
Circular / orphan detectionyesyes
Path-to-path forbidden rulesyes (generic from/to)yes (module boundaries)
Reachability rules - deny + whitelistdeny native; whitelist via negated from (pathNot)dedicated checks both ways (restricted imports + restricted importers)
Unused / missing dependenciespartialyes
Unused exportsnoyes
Graph visualization (dot/mermaid/HTML)yesno
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, restricted importers (the reverse - whitelist which entry points may reach a file or banned package), circular, and orphan files are dedicated detectors rather than generic from/to rules. The whitelist direction in particular is awkward in dependency-cruiser (a negated pathNot reachability rule) and a first-class check in rev-dep.
  • Broader hygiene - it also detects unused/missing dependencies and unused exports.
  • Speed across large monorepos. On a 580k-LoC project (benchmark) rev-dep is 50x faster on module boundaries (164 ms vs 8.1 s), 65x on restricted imports (170 ms vs 11.0 s) and 52x on restricted importers (179 ms vs 9.2 s).

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.