# read-yaml-file

> Read and parse a YAML file

Latest version **3.0.0** (published 2026-03-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install read-yaml-file
pnpm add read-yaml-file
yarn add read-yaml-file
bun add read-yaml-file
```

## Health

**Score 55/100 (C)** — status: active.

Positive: esm support; no vulnerabilities; high maintenance score.

Warnings: low downloads; no types.

## Facts

| | |
|---|---|
| Version | 3.0.0 |
| Published | 2026-03-11 |
| First published | 2018-11-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | >=22.13 |
| Dependencies | 2 |
| Unpacked size | 3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 104 |
| Author | Zoltan Kochan |
| Maintainers | zkochan |
| Keywords | yaml, read |

## Links

- npm: https://www.npmjs.com/package/read-yaml-file
- Repository: https://github.com/zkochan/packages/tree/main/read-yaml-file
- npm.io page: https://npm.io/package/read-yaml-file

## Dependencies (2)

- [js-yaml](https://npm.io/package/js-yaml.md) ^4.1.1
- [strip-bom](https://npm.io/package/strip-bom.md) ^5.0.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

- 3.0.0 (latest) — 2026-03-11
- 2.1.0 (next) — 2021-02-11
- 2.0.0 (pnpm-temp) — 2020-03-26
- 2.0.1 — 2021-01-09
- 1.1.0 — 2018-11-29
- 1.0.0 — 2018-11-29

## README

# read-yaml-file

> Read and parse a YAML file

[![npm version](https://img.shields.io/npm/v/read-yaml-file.svg)](https://www.npmjs.com/package/read-yaml-file)

## Installation

```sh
<npm|yarn|pnpm> add read-yaml-file
```

## Usage

```js
const readYamlFile = require('read-yaml-file')

readYamlFile('foo.yml').then(data => {
  console.log(data)
  //=> {foo: true}
})
```

## API

### readYamlFile(filepath)

Returns a promise for the parsed YAML.

### readYamlFile.sync(filepath)

Returns the parsed YAML.

## Related

- [write-yaml-file](https://github.com/zkochan/packages/tree/main/write-yaml-file) - Stringify and write YAML to a file atomically

## License

[MIT](./LICENSE) © [Zoltan Kochan](https://www.kochan.io)

***

This package was forked from [load-yaml-file](https://github.com/LinusU/load-yaml-file)

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