# read-pubspec

> Read a pubspec.yaml file

Latest version **8.0.2** (published 2026-09-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install read-pubspec
pnpm add read-pubspec
yarn add read-pubspec
bun add read-pubspec
```

## Health

**Score 65/100 (B)** — status: active.

Positive: esm support; no vulnerabilities; has provenance; recently updated; high maintenance score.

Warnings: low downloads; no types.

## Facts

| | |
|---|---|
| Version | 8.0.2 |
| Published | 2026-09-21 |
| First published | 2020-10-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM |
| Node | >=22 |
| Dependencies | 1 |
| Unpacked size | 4.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Kirk Eaton |
| Maintainers | kirkeaton |
| Keywords | dart, file, flutter, load, parse, pubspec, read, yaml |

## Links

- npm: https://www.npmjs.com/package/read-pubspec
- Repository: https://github.com/kirkeaton/read-pubspec
- Homepage: https://github.com/kirkeaton/read-pubspec#readme
- Issues: https://github.com/kirkeaton/read-pubspec/issues
- Funding: https://kirkeaton.ca/sponsor
- npm.io page: https://npm.io/package/read-pubspec

## Dependencies (1)

- [yaml](https://npm.io/package/yaml.md) 2.9.1

## 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

- 8.0.2 (latest) — 2026-09-21
- 8.0.1 — 2026-05-18
- 8.0.0 — 2026-05-17
- 7.1.1 — 2026-05-11
- 7.1.0 — 2026-05-08
- 7.0.4 — 2026-04-05
- 7.0.3 — 2025-12-29
- 7.0.2 — 2025-12-06
- 4.1.2 — 2025-08-17
- 5.1.5 — 2025-08-17
- 6.1.3 — 2025-08-17
- 7.0.1 — 2025-08-17
- 7.0.0 — 2025-08-13
- 6.1.2 — 2025-08-13
- 6.1.1 — 2025-05-15
- … 31 more at https://npm.io/package/read-pubspec/versions

## README

# read-pubspec

Read a pubspec.yaml file

## Install

```
$ npm install read-pubspec
```

## Usage

```js
import path from 'node:path';
import { readPubspec } from 'read-pubspec';

process.chdir(path.join(__dirname, '/test'));

console.log(await readPubspec());
//=> { name: 'root', … }

console.log(await readPubspec({ cwd: path.join(process.cwd(), '/sub') }));
//=> { name: 'sub', … }
```

## API

### readPubspec(options?)

Returns a `Promise<Pubspec>` with the parsed YAML.

#### options

Type: `ReadPubspecOptions`

#### options.cwd

Type: `string`<br>
Default: `process.cwd()`

Current working directory

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