Documentation for Simbo's Packages
    Preparing search index...

    Module @simbo/monorepo-utils - v2.0.0

    Monorepo Utilities

    📦 @simbo/monorepo-utils

    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:

      • pnpm (pnpm-workspace.yaml)
      • npm (package.json)
    • 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

    Requires Node.js ^22.22.2 || ^24.15.0 || >=26.0.0.

    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 { getPackagePathByName } from '@simbo/monorepo-utils';

    const packagePath = await getPackagePathByName('my-package');

    MIT © Simon Lepel

    GetPackagePathByNameOptions
    GetWorkspaceMetadataOptions
    GetWorkspacePathsOptions
    GetWorkspacePatternsOptions
    ReadWorkspacesOptions
    WorkspaceMetadata
    ValidatedPackageJson
    getPackagePathByName
    getWorkspaceMetadata
    getWorkspacePaths
    getWorkspacePatterns
    readWorkspaces