A set of utilities for inspecting and working with monorepo workspaces.
Includes functions for reading workspace metadata, resolving paths, and working with package manifests.
Detect and read all workspaces in a repository
Supports workspace patterns from different monorepo setups:
Validate and parse workspaces' package.json
files
Extract metadata such as name, version, description, and README title
Manage concurrency when scanning large monorepos
Fully typed with TypeScript
Install @simbo/monorepo-utils
from the npm registry:
npm i [-D] @simbo/monorepo-utils
For a complete API reference, see the documentation.
Concurrently find and read all workspaces in a monorepo.
Returns an array of WorkspaceMetadata
objects.
import { readWorkspaces } from '@simbo/monorepo-utils';
const workspaces = await readWorkspaces();
Get the WorkspaceMetadata
for a workspace path.
import { getWorkspaceMetadata } from '@simbo/monorepo-utils';
const metadata = await getWorkspaceMetadata('my-workspace');
Get all workspace paths in a monorepo.
Returns an array of path strings.
import { getWorkspacePaths } from '@simbo/monorepo-utils';
const paths = await getWorkspacePaths();
Get all workspace patterns in a monorepo.
Returns an array of pattern strings.
import { getWorkspacePatterns } from '@simbo/monorepo-utils';
const patterns = await getWorkspacePatterns();
Get the file system path of a package by its name.
import { getPackagePath } from '@simbo/monorepo-utils';
const packagePath = await getPackagePath({ packageName: 'my-package' });