https://github.com/tkloht/cyclic-dependencies
Find cyclic dependencies in your yarn/npm workspaces
https://github.com/tkloht/cyclic-dependencies
cyclic-dependency lerna monorepo npm workspaces yarn
Last synced: 10 months ago
JSON representation
Find cyclic dependencies in your yarn/npm workspaces
- Host: GitHub
- URL: https://github.com/tkloht/cyclic-dependencies
- Owner: tkloht
- License: mit
- Created: 2022-06-18T12:24:18.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2025-03-20T22:28:54.000Z (11 months ago)
- Last Synced: 2025-04-10T00:16:01.811Z (10 months ago)
- Topics: cyclic-dependency, lerna, monorepo, npm, workspaces, yarn
- Language: JavaScript
- Homepage:
- Size: 102 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# cyclic-dependencies
> Find cyclic dependencies in your yarn/npm/pnpm workspaces.
## Usage example
In the root folder of a project using workspaces:
```
❯ npx cyclic-dependencies
Cyclic dependencies found in workspace: [ 'app -> hello -> app' ]
```
To exit with a failure code:
```
npx cyclic-dependencies --reject
```
You can also use it in your own script:
```js
import findCyclicDependencies from "cyclic-dependencies"
const cycles = await findCyclicDependencies()
// [['app', 'hello', 'app']]
```
(These examples assume you have two packages `app` and `hello`, where `app` depends on `hello` and `hello` depends on `app`)
## Development setup
This project uses pnpm to manage dependencies.
At this time it has no build step.
To run tests with jest: `pnpm test`
## License
MIT