# @pnpm/modules-yaml

> Reads/writes `node_modules/.modules.yaml`

Latest version **1002.0.1** (published 2026-02-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install @pnpm/modules-yaml
pnpm add @pnpm/modules-yaml
yarn add @pnpm/modules-yaml
bun add @pnpm/modules-yaml
```

## Health

**Score 70/100 (B)** — status: stable.

Positive: has types; esm support; no vulnerabilities; high maintenance score; high quality score; popular repo.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 1002.0.1 |
| Published | 2026-02-17 |
| First published | 2018-03-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=18.12 |
| Dependencies | 5 |
| Unpacked size | 12.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 36527 |
| Maintainers | pnpmuser, zkochan |
| Keywords | pnpm, pnpm10, modules.yaml |

## Links

- npm: https://www.npmjs.com/package/@pnpm/modules-yaml
- Repository: https://github.com/pnpm/pnpm.git#main
- Homepage: https://github.com/pnpm/pnpm/tree/main/pkg-manager/modules-yaml#readme
- Issues: https://github.com/pnpm/pnpm/issues
- Funding: https://opencollective.com/pnpm
- npm.io page: https://npm.io/package/@pnpm/modules-yaml

## Dependencies (5)

- [ramda](https://npm.io/package/ramda.md) npm:@pnpm/ramda@0.28.1
- [is-windows](https://npm.io/package/is-windows.md) ^1.0.2
- [@pnpm/types](https://npm.io/package/@pnpm/types.md) 1001.3.0
- [read-yaml-file](https://npm.io/package/read-yaml-file.md) ^2.1.0
- [@pnpm/graceful-fs](https://npm.io/package/@pnpm/graceful-fs.md) 1000.1.0

## Alternatives

- [monaco-yaml](https://npm.io/package/monaco-yaml.md) — 420.1K weekly downloads
- [@crewx/workflow](https://npm.io/package/@crewx/workflow.md) — 3.1K weekly downloads
- [yaml-cat](https://npm.io/package/yaml-cat.md) — 38 weekly downloads
- [nunjucks-in-yaml](https://npm.io/package/nunjucks-in-yaml.md) — 9 weekly downloads
- [shopify-symlinks](https://npm.io/package/shopify-symlinks.md) — 3 weekly downloads

## Recent versions

- 1002.0.1 (latest) — 2026-02-17
- 1002.0.2 (latest-10) — 2026-06-10
- 9.1.2 (latest-6) — 2022-07-05
- 8.0.2 (pnpm-temp) — 2020-07-31
- 4.0.0-1 (next) — 2019-09-28
- 1002.0.0 — 2026-02-07
- 1001.0.2 — 2026-01-19
- 1001.0.1 — 2025-12-15
- 1001.0.0 — 2025-12-08
- 1000.3.8 — 2025-11-20
- 1000.3.7 — 2025-11-09
- 1000.3.6 — 2025-10-21
- 1000.3.5 — 2025-09-12
- 1000.3.4 — 2025-07-23
- 1000.3.3 — 2025-05-13
- … 79 more at https://npm.io/package/@pnpm/modules-yaml/versions

## README

# @pnpm/modules-yaml

> Reads/writes \`node_modules/.modules.yaml\`

<!--@shields('npm')-->
[![npm version](https://img.shields.io/npm/v/@pnpm/modules-yaml.svg)](https://www.npmjs.com/package/@pnpm/modules-yaml)
<!--/@-->

## Installation

```sh
pnpm add @pnpm/modules-yaml
```

## Usage

```ts
import {write, read} from '@pnpm/modules-yaml'

await write('node_modules', {
  hoistedAliases: {},
  layoutVersion: 1,
  packageManager: 'pnpm@1.0.0',
  pendingBuilds: [],
  shamefullyFlatten: false,
  skipped: [],
  storeDir: '/home/user/.pnpm-store',
})

const modulesYaml = await read(`node_modules`)
```

## API

### `read(pathToDir): Promise<ModulesObject>`

Reads `.modules.yaml` from the specified directory.

### `write(pathToDir, ModulesObject): Promise<void>`

Writes a `.modules.yaml` file to the specified directory.

## License

MIT

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