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

    Function findMonorepoRoot

    • Finds the root of the monorepo that contains the working directory.

      Searches the working directory and its parents for a workspace configuration of a supported package manager, such as pnpm-workspace.yaml or workspaces in package.json next to a package-lock.json. Unlike the root of a Git repository, this is also correct in Git worktrees and for monorepos inside other repositories.

      Parameters

      Returns Promise<string | undefined>

      The absolute path of the monorepo root, or undefined if no monorepo contains the directory.

      If a configuration file or a workspace manifest cannot be read.