yarn-workspaces-list

yarn workspaces list

Usage no npm install needed!

<script type="module">
  import yarnWorkspacesList from 'https://cdn.skypack.dev/yarn-workspaces-list';
</script>

README

yarn-workspaces-list

List all available workspaces using the format from yarn workspaces list --verbose --json from yarn v2.

const { listWorkspaces } = require('yarn-workspaces-list');

const list = await listWorkspaces();
$ workspaces-list

{"location":".","name":"@workspace/monorepo","workspaceDependencies":[],"mismatchedWorkspaceDependencies":[]}
{"location":"packages/a","name":"@workspace/a",...}
{"location":"packages/b","name":"@workspace/b","workspaceDependencies":["packages/a"],...}