Skip to main content

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 (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.

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.