mirror of
https://github.com/pnpm/pnpm.git
synced 2026-04-11 02:29:48 -04:00
Reorganize the monorepo's top-level domain directories for clarity: - pkg-manager/ split into: - installing/ (core, headless, client, resolve-dependencies, etc.) - installing/linking/ (hoist, direct-dep-linker, modules-cleaner, etc.) - bins/ (link-bins, package-bins, remove-bins) - completion/ merged into cli/ - dedupe/ moved to installing/dedupe/ - env/ renamed to engine/ with subdomains: - engine/runtime/ (node.fetcher, node.resolver, plugin-commands-env, etc.) - engine/pm/ (plugin-commands-setup, plugin-commands-self-updater) - env.path moved to shell/ - tools/ and runtime/ dissolved - reviewing/ and lockfile audit packages moved to deps/: - deps/inspection/ (list, outdated, dependencies-hierarchy) - deps/compliance/ (audit, licenses, sbom) - registry/ moved to resolving/registry/ - semver/peer-range moved to deps/ - network/fetching-types moved to fetching/ - packages/ slimmed down, moving packages to proper domains: - calc-dep-state, dependency-path -> deps/ - parse-wanted-dependency -> resolving/ - git-utils -> network/ - naming-cases -> text/ - make-dedicated-lockfile -> lockfile/ - render-peer-issues -> installing/ - plugin-commands-doctor -> cli/ - plugin-commands-init -> workspace/ Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
46 lines
842 B
Markdown
46 lines
842 B
Markdown
# @pnpm/modules-yaml
|
|
|
|
> Reads/writes \`node_modules/.modules.yaml\`
|
|
|
|
<!--@shields('npm')-->
|
|
[](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
|