get-monorepo-packages
Version:
Get a list of packages from a monorepo
32 lines (22 loc) • 1.2 kB
Markdown
# `get-monorepo-packages`
[](https://travis-ci.org/azz/get-monorepo-packages)
[](https://github.com/prettier/prettier)
[](https://npmjs.org/get-monorepo-packages)
[](https://github.com/semantic-release/semantic-release)
[](LICENSE)
Get a list of packages from a monorepo. Supports:
* [Lerna](https://github.com/lerna/lerna)
* [Yarn workspaces](https://yarnpkg.com/lang/en/docs/workspaces/)
* [Bolt](http://boltpkg.com/)
## Install
```bash
npm install --save get-monorepo-packages
```
## Usage
```js
import getPackages from 'get-monorepo-packages';
getPackages('/path/to/root');
```
Returns an array of objects containing:
* `location` - The relative path to the package.
* `package` - The `package.json` file for the package.