Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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: 3 days ago
JSON representation

Find cyclic dependencies in your yarn/npm workspaces

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