Back to Pnpm

@pnpm/installing.modules-yaml

installing/modules-yaml/README.md

11.0.6891 B
Original Source

@pnpm/installing.modules-yaml

Reads/writes `node_modules/.modules.yaml`

<!--@shields('npm')-->

<!--/@-->

Installation

sh
pnpm add @pnpm/installing.modules-yaml

Usage

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

await write('node_modules', {
  hoistedAliases: {},
  layoutVersion: 1,
  packageManager: '[email protected]',
  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