Enforce JavaScript and TypeScript dependency rules before architectural drift spreads with dependency-cruiser
Scan a JS or TS codebase for forbidden imports, circular dependencies, orphaned modules, and other dependency-rule violations before they turn into structural drift.
Prerequisites
Node.js, npm or pnpm
Installation
Use the upstream install or setup path that matches your environment:
- npm install --save-dev dependency-cruiser
- yarn add -D dependency-cruiser
- pnpm add -D dependency-cruiser
- npx depcruise --init
Basic usage or getting-started notes:
shell
or
... and generate a config
Extracted from upstream docs: https://raw.githubusercontent.com/sverweij/dependency-cruiser/HEAD/README.md