https://github.com/bubkoo/find-monorepo-root
Find the root directory of a monorepo using Yarn workspaces, Bolt, Lerna or pnpm
https://github.com/bubkoo/find-monorepo-root
lerna-monorepo monorepo pnpm-workspaces workspaces yarn-workspaces
Last synced: 7 months ago
JSON representation
Find the root directory of a monorepo using Yarn workspaces, Bolt, Lerna or pnpm
- Host: GitHub
- URL: https://github.com/bubkoo/find-monorepo-root
- Owner: bubkoo
- License: mit
- Created: 2022-11-08T02:09:39.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-12-16T08:19:47.000Z (over 3 years ago)
- Last Synced: 2025-10-19T00:09:18.573Z (7 months ago)
- Topics: lerna-monorepo, monorepo, pnpm-workspaces, workspaces, yarn-workspaces
- Language: TypeScript
- Homepage:
- Size: 105 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
find-monorepo-root
Find the root directory of a monorepo using Yarn workspaces, Bolt, Lerna or pnpm
## Install
```shell
$ npm install find-monorepo-root
```
## Usage
```ts
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](https://github.com/bubkoo/find-monorepo-root/issues) for bug reports or suggestions first.
To become a contributor, please follow our [contributing guide](/CONTRIBUTING.md).
## License
The scripts and documentation in this project are released under the [MIT License](LICENSE)