# @manypkg/get-packages

> > A simple utility to get the packages from a monorepo, whether they're using Yarn, npm, Lerna, pnpm, Bun or Rush

Latest version **3.1.0** (published 2025-07-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install @manypkg/get-packages
pnpm add @manypkg/get-packages
yarn add @manypkg/get-packages
bun add @manypkg/get-packages
```

## Health

**Score 40/100 (D)** — status: stable.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 3.1.0 |
| Published | 2025-07-25 |
| First published | 2020-03-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM |
| Node | >=20.0.0 |
| Dependencies | 2 |
| Unpacked size | 23.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1045 |
| Maintainers | manypkg-release-bot, emmatown |

## Links

- npm: https://www.npmjs.com/package/@manypkg/get-packages
- Repository: https://github.com/Thinkmill/manypkg
- Homepage: https://github.com/Thinkmill/manypkg#readme
- Issues: https://github.com/Thinkmill/manypkg/issues
- npm.io page: https://npm.io/package/@manypkg/get-packages

## Dependencies (2)

- [@manypkg/tools](https://npm.io/package/@manypkg/tools.md) ^2.1.0
- [@manypkg/find-root](https://npm.io/package/@manypkg/find-root.md) ^3.1.0

## Recent versions

- 3.1.0 (latest) — 2025-07-25
- 3.0.0 — 2025-05-01
- 2.2.2 — 2024-06-27
- 2.2.1 — 2024-03-15
- 2.2.0 — 2023-06-09
- 2.1.0 — 2023-01-31
- 2.0.0 — 2023-01-23
- 1.1.3 — 2021-11-09
- 1.1.2 — 2021-10-28
- 1.1.1 — 2020-08-11
- 1.1.0 — 2020-06-25
- 1.0.1 — 2020-03-28
- 1.0.0 — 2020-03-07

## README

# @manypkg/get-packages

> A simple utility to get the packages from a monorepo, whether they're using Yarn, npm, Lerna, pnpm, Bun or Rush

This library exports `getPackages` and `getPackagesSync`. It is intended mostly for use of developers building tools that want to support different kinds of monorepos as an easy way to write tools without having to write tool-specific code. It supports Yarn, npm, Lerna, pnpm, Bun, Rush and single-package repos(where the only package is the the same as the root package). This library uses `@manypkg/find-root` to search up from the directory that's passed to `getPackages` or `getPackagesSync` to find the project root.

```typescript
import { getPackages, getPackagesSync } from "@manypkg/get-packages";

const { tool, packages, rootPackage, rootDir } = await getPackages(
  process.cwd()
);
const { tool, packages, rootPackage, rootDir } = getPackagesSync(process.cwd());

// From @manypkg/tools

interface Tool {
  readonly type: string;
  isMonorepoRoot(directory: string): Promise<boolean>;
  isMonorepoRootSync(directory: string): boolean;
  getPackages(directory: string): Promise<Packages>;
  getPackagesSync(directory: string): Packages;
}

interface Package {
  packageJson: PackageJSON;
  dir: string;
  relativeDir: string;
}

interface Packages {
  tool: Tool;
  packages: Package[];
  rootPackage?: Package;
  rootDir: string;
}
```

---
_Source: https://npm.io/package/@manypkg/get-packages · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
