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

https://github.com/remorses/workspace-info

Yarn workspace info for yarn v2 and any other similar workspaces implementation
https://github.com/remorses/workspace-info

Last synced: 7 months ago
JSON representation

Yarn workspace info for yarn v2 and any other similar workspaces implementation

Awesome Lists containing this project

README

          

# workspace-info

`yarn workspace info --json` implementation for yarn v2 berry, lerna and npm workspaces

```
yarn add workspace-info
```

## Usage as cli

```
workspace-info --cwd tests/example-workspace
```

by default peer dependencies are not included, use `--peer` to include them
```
workspace-info --peer
```

## Usage as lib

```js
import { getWorkspaceInfo } from 'workspace-info'

console.log(
await getWorkspaceInfo({
cwd,
useLerna: false,
}),
)

// {
// a: {
// location: '.../tests/example-workspace/packages/a',
// mismatchedWorkspaceDependencies: [],
// workspaceDependencies: ['b', 'd'],
// },
// b: {
// location: '.../tests/example-workspace/packages/b',
// mismatchedWorkspaceDependencies: [],
// workspaceDependencies: ['d'],
// },
// c: {
// location: '.../tests/example-workspace/packages/c',
// mismatchedWorkspaceDependencies: [],
// workspaceDependencies: ['b'],
// },
// d: {
// location: '.../tests/example-workspace/packages/d',
// mismatchedWorkspaceDependencies: [],
// workspaceDependencies: ['c'],
// },
// }
```