# @wixc3/resolve-directory-context

> Helpers to get information about single/multi-package contexts

Latest version **5.0.1** (published 2025-04-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install @wixc3/resolve-directory-context
pnpm add @wixc3/resolve-directory-context
yarn add @wixc3/resolve-directory-context
bun add @wixc3/resolve-directory-context
```

## Health

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

Positive: esm support; no vulnerabilities; high maintenance score.

Warnings: low downloads; no types.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 5.0.1 |
| Published | 2025-04-29 |
| First published | 2021-08-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM |
| Node | >=20 |
| Dependencies | 2 |
| Unpacked size | 43 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Wix.com |
| Maintainers | tomrav, avi.vahl, alexswix, devex-infra, iuriikowix, pijusn, omerk, talga, cijoe, wix-ci, wixnpm, baraki, interal, alisey, danieleww, idoros, nadavwix, rashellek, wtfil, denysdovhan, vkobeliatskyi, pistolpete_, nettaru, igalh, netanelgilad, anatfenn, erezshasha, zemlanin, arnonkehat, ariki, itpurchases, danalevy, serhiiz, oleksandraab, idango10, mikanadel, tetiana0611, vladkar, yurii-v, elig-wix, nadav.a, vladyslavgoloshchapov, shireewill, thealmightycrumb, itaywix, olehr, haryelp, ekaterinaza, matang, ilyakwix, noammu, plisovyi, alissawix, daomry, dlvhdr, shakederin, noama, gregdamsky, dorza, 0xrezaa, yuriin, ranberko91, vladyslav-baliuk, yurimorkovnik, vladba-wix, danielgovrin, buchenpilar, oleksiiletushev, alisalachman, talwe |
| Keywords | packages, directory, workspace, npm, yarn |

## Links

- npm: https://www.npmjs.com/package/@wixc3/resolve-directory-context
- Repository: https://github.com/wixplosives/resolve-directory-context
- Homepage: https://github.com/wixplosives/resolve-directory-context#readme
- Issues: https://github.com/wixplosives/resolve-directory-context/issues
- npm.io page: https://npm.io/package/@wixc3/resolve-directory-context

## Dependencies (2)

- [minimatch](https://npm.io/package/minimatch.md) ^10.0.1
- [type-fest](https://npm.io/package/type-fest.md) ^4.40.1

## Recent versions

- 5.0.1 (latest) — 2025-04-29
- 5.0.0 — 2025-04-28
- 4.0.0 — 2023-07-16
- 3.0.5 — 2023-04-12
- 3.0.4 — 2023-02-20
- 3.0.3 — 2023-01-15
- 3.0.2 — 2022-12-26
- 3.0.1 — 2022-09-21
- 3.0.0 — 2022-05-14
- 2.0.0 — 2022-02-14
- 1.0.4 — 2022-01-12
- 1.0.3 — 2021-12-14
- 1.0.2 — 2021-12-14
- 1.0.1 — 2021-08-24

## README

# @wixc3/resolve-directory-context

[![Build Status](https://github.com/wixplosives/resolve-directory-context/workflows/tests/badge.svg)](https://github.com/wixplosives/resolve-directory-context/actions)
[![npm version](https://badge.fury.io/js/%40wixc3%2Fresolve-directory-context.svg)](https://badge.fury.io/js/%40wixc3%2Fresolve-directory-context)

Helpers to get information about single/multi-package contexts.

## Features

Supports:

- single packages
- `"workspaces"` in `package.json` (yarn or npm@7)
- `lerna.json` defined workspaces

## API

- `resolveDirectoryContext`

```ts
import fs from 'fs';
import path from 'path';
import { resolveDirectoryContext } from '@wixc3/resolve-directory-context';

const context = resolveDirectoryContext(basePath, { ...fs, ...path });
if (context.type === 'multi') {
  // context.rootPackage === {...}
  // context.packages === [{...}, {...}]
} else {
  // context.type === 'single'
  // context.npmPackage === {...}
}
```

### License

MIT

---
_Source: https://npm.io/package/@wixc3/resolve-directory-context · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
