# yaml-unist-parser

> A YAML parser that produces output compatible with unist

Latest version **3.2.1** (published 2026-09-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install yaml-unist-parser
pnpm add yaml-unist-parser
yarn add yaml-unist-parser
bun add yaml-unist-parser
```

## 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 | 3.2.1 |
| Published | 2026-09-12 |
| First published | 2018-05-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM |
| Node | >= 14 |
| Dependencies | 1 |
| Unpacked size | 67.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| Author | Ika |
| Maintainers | thorn0, fisker, ikatyang |
| Keywords | unist, yaml |

## Links

- npm: https://www.npmjs.com/package/yaml-unist-parser
- Repository: https://github.com/prettier/yaml-unist-parser
- Homepage: https://github.com/prettier/yaml-unist-parser#readme
- Issues: https://github.com/prettier/yaml-unist-parser/issues
- npm.io page: https://npm.io/package/yaml-unist-parser

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

- 3.2.1 (latest) — 2026-09-12
- 3.2.0 — 2026-06-01
- 3.1.0 — 2025-12-03
- 3.0.0 — 2025-12-03
- 2.2.1 — 2025-12-03
- 2.2.0 — 2025-12-03
- 2.1.1 — 2025-11-21
- 2.1.0 — 2025-11-21
- 2.0.5 — 2025-03-21
- 2.0.4 — 2025-03-21
- 2.0.3 — 2025-03-20
- 2.0.2 — 2025-03-20
- 2.0.1 — 2022-10-14
- 2.0.0 — 2022-10-14
- 1.3.1 — 2020-09-08
- … 17 more at https://npm.io/package/yaml-unist-parser/versions

## README

# yaml-unist-parser

[![npm](https://img.shields.io/npm/v/yaml-unist-parser.svg?style=flat-square)](https://www.npmjs.com/package/yaml-unist-parser)
[![coverage](https://img.shields.io/codecov/c/github/prettier/yaml-unist-parser.svg?style=flat-square)](https://codecov.io/gh/prettier/yaml-unist-parser)

A YAML parser that produces output compatible with [unist](https://github.com/syntax-tree/unist)

## Features

- better node positioning
- better comment attaching
- [unist-compatible AST](https://github.com/prettier/yaml-unist-parser/blob/main/src/types.ts)

## Install

```sh
# using npm
npm install --save yaml-unist-parser

# using yarn
yarn add yaml-unist-parser
```

## Usage

```ts
import { parse } from "yaml-unist-parser";

const ast = parse(`
- hello
- world
`);
```

## Options

### `uniqueKeys`

type `boolean`\
default: `true`

Whether key uniqueness is checked.

```js
parse("a: 1\na: 2");
// Uncaught SyntaxError [YAMLSyntaxError]: Map keys must be unique

parse("a: 1\na: 2", { uniqueKeys: false });
// {type: 'root',...}
```

## Development

```sh
# lint
yarn run lint

# build
yarn run build

# test
yarn run test
```

## License

MIT © [Ika](https://github.com/ikatyang)

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