# find-yarn-workspace-root2

> Algorithm for finding the root of a yarn workspace, extracted from yarnpkg.com

Latest version **1.2.55** (published 2026-09-06) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install find-yarn-workspace-root2
pnpm add find-yarn-workspace-root2
yarn add find-yarn-workspace-root2
bun add find-yarn-workspace-root2
```

## Health

**Score 65/100 (B)** — status: active.

Positive: has types; no vulnerabilities; recently updated; high maintenance score; high quality score.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 1.2.55 |
| Published | 2026-09-06 |
| First published | 2019-05-07 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 63.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 14 |
| Author | Square, Inc. |
| Maintainers | bluelovers |

## Links

- npm: https://www.npmjs.com/package/find-yarn-workspace-root2
- Repository: https://github.com/bluelovers/ws-yarn-workspaces
- Homepage: https://github.com/bluelovers/ws-yarn-workspaces/tree/master/packages/find-yarn-workspace-root2#readme
- Issues: https://github.com/bluelovers/ws-yarn-workspaces/issues
- npm.io page: https://npm.io/package/find-yarn-workspace-root2

## Dependencies (4)

- [tslib](https://npm.io/package/tslib.md) >=2.8.1
- [upath2](https://npm.io/package/upath2.md) ^3.1.25
- [pkg-dir](https://npm.io/package/pkg-dir.md) <6 >=5
- [micromatch](https://npm.io/package/micromatch.md) ^4.0.8

## Recent versions

- 1.2.55 (latest) — 2026-09-06
- 1.2.54 — 2026-04-26
- 1.2.53 — 2026-03-09
- 1.2.52 — 2026-03-02
- 1.2.51 — 2025-09-07
- 1.2.50 — 2024-05-03
- 1.2.49 — 2022-11-14
- 1.2.48 — 2022-10-28
- 1.2.47 — 2022-10-01
- 1.2.46 — 2022-09-29
- 1.2.45 — 2022-09-28
- 1.2.44 — 2022-09-27
- 1.2.43 — 2022-09-06
- 1.2.42 — 2022-08-26
- 1.2.41 — 2022-08-13
- … 35 more at https://npm.io/package/find-yarn-workspace-root2/versions

## README

# find-yarn-workspace-root

[![Build Status](https://travis-ci.org/square/find-yarn-workspace-root.svg?branch=master)](https://travis-ci.org/square/find-yarn-workspace-root)

Algorithm for finding the root of a yarn workspace, extracted from yarnpkg.com

## Installation
```bash
yarn add find-yarn-workspace-root
```

## Usage
```js
const findWorkspaceRoot = require('find-yarn-workspace-root');

const workspaceRoot = findWorkspaceRoot(__dirname); // Absolute path or null
```

## Contributing

Contributions are welcome! Just clone this repository and install the dependencies:

```bash
git clone https://github.com/square/find-yarn-workspace-root.git
cd find-yarn-workspace-root
yarn
```

Note that you'll need `node` and `yarn` installed. Next, verify the tests all pass:

```bash
yarn test
```

Then create a branch for your bugfix/feature, make changes and update the tests, and submit a pull request. Please do not change the version in `package.json` when submitting a pull request. We determine the next version automatically based on the commits since the last release.

> *NOTE*: Commit messages follow the [Angular commit message guidelines](https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#commits).

## Releases

Releases are handled by Travis CI once a build succeeds on `master`. To trigger a release, bump the version using `standard-version`:

```bash
$(yarn bin)/standard-version
```

That should update the CHANGELOG, bump the version in `package.json`, and create a git tag. Then, just `git push && git push --tags`.

---
Copyright 2017 Square, Inc.

---
_Source: https://npm.io/package/find-yarn-workspace-root2 · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
