File and package cycles
Loops between files inside each package, and between the packages of an npm, yarn, pnpm or bun workspace. One representative loop per tangle, so the report is a to-do list rather than thousands of overlapping paths.
npm install --save-dev jscyclesnpx jscyclespnpm add --save-dev jscyclespnpm exec jscyclesyarn add --dev jscyclesyarn jscyclesbun add --dev jscyclesbunx jscyclesOn a checkout of ts-morph:
✓ No inter-package cycles
✗ @ts-morph/common: 2 cycles src/collections/SortedKeyValueArray.ts -> src/utils/index.ts -> … -> src/collections/SortedKeyValueArray.ts src/typescript/index.ts -> src/typescript/tsInternal.ts -> src/typescript/index.ts
✗ ts-morph: 3 cycles … src/Project.ts -> src/ProjectContext.ts -> src/Project.ts
Summary: 3 packages, 2 with file cycles (5 total), 0 inter-package cyclesThe exit status is 1, so a CI step fails until the cycles are fixed.
File and package cycles
Loops between files inside each package, and between the packages of an npm, yarn, pnpm or bun workspace. One representative loop per tangle, so the report is a to-do list rather than thousands of overlapping paths.
Resolves like TypeScript
Path aliases, extends chains through node_modules, declaration files,
and .js specifiers that point at .ts sources. Optionally ignores
imports that only carry types.
Never a false clean
Exit status 0 means no cycles, 1 means cycles, 2 means the scan could
not finish. A file that cannot be parsed fails the scan instead of leaving
a hole in the graph.
Fast, with no runtime
A single Rust binary that parses with tree-sitter in parallel. Prebuilt for Linux (static, Alpine too), macOS and Windows; nothing runs at install time, and it never touches the network.
packages directory; shorter is faster. Median of five runs on an Apple M3 Pro. Method and table.