Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

find-monorepo-root

bubkoo2.2kMIT1.0.3TypeScript support: included

Find the root directory of a monorepo using Yarn workspaces, Bolt, Lerna or pnpm

monorepo, monorepo-root, root, workspaces, yarn-monorepo, yarn-workspaces, yarn, lerna-monorepo, lerna-workspaces, lerna, pnpm-workspaces, pnpm-monorepo, pnpm, Bolt

readme

find-monorepo-root

Find the root directory of a monorepo using Yarn workspaces, Bolt, Lerna or pnpm

MIT License Language PRs Welcome

build coverage NPM Package NPM Downloads

Install

$ npm install find-monorepo-root

Usage

import { findMonorepoRoot } from 'find-monorepo-root';
const cwd = process.cwd();

console.log(await findMonorepoRoot(cwd));
// {
//   client: 'pnpm', // the monorepo client(pnpm, lerna, yarn, bolt)
//   dir: 'xxx',     // the monorepo root directory
// }


// sync method
import { findMonorepoRootSync } from 'find-monorepo-root/sync';
console.log(findMonorepoRootSync(cwd));

Contributing

Please let us know how can we help. Do check out issues for bug reports or suggestions first.

To become a contributor, please follow our contributing guide.

License

The scripts and documentation in this project are released under the MIT License

changelog

1.0.3 (2022-12-16)

1.0.2 (2022-11-08)

1.0.1 (2022-11-08)

1.0.0 (2022-11-08)