mirror of
https://github.com/pnpm/pnpm.git
synced 2026-07-21 21:22:26 -04:00
40 lines
698 B
Markdown
40 lines
698 B
Markdown
# @pnpm/pkg-manifest.reader
|
|
|
|
> Read a package.json
|
|
|
|
<!--@shields('npm')-->
|
|
[](https://npmx.dev/package/@pnpm/pkg-manifest.reader)
|
|
<!--/@-->
|
|
|
|
## Installation
|
|
|
|
```sh
|
|
pnpm add @pnpm/pkg-manifest.reader
|
|
```
|
|
|
|
## Usage
|
|
|
|
```ts
|
|
import { readPackageJson } from '@pnpm/pkg-manifest.reader'
|
|
|
|
const pkgJson = await readPackageJson('package.json')
|
|
```
|
|
|
|
## API
|
|
|
|
### default: `readPackageJson(path): Promise<PackageManifest>`
|
|
|
|
### Arguments
|
|
|
|
- `path` - _String_ - path to the `package.json`
|
|
|
|
### `fromDir(path): Promise<PackageManifest>`
|
|
|
|
### Arguments
|
|
|
|
- `path` - _String_ - path to the directory with the `package.json`
|
|
|
|
## License
|
|
|
|
MIT
|