# js-yaml

> YAML 1.2 parser and serializer

Latest version **5.4.2** (published 2026-09-13) · MIT license · 0 weekly downloads

> **Better alternative:** See documentation for alternatives (https://github.com/AikidoSec/module-replacements/blob/main/docs/js-yaml)

## Install

```sh
npm install js-yaml
pnpm add js-yaml
yarn add js-yaml
bun add js-yaml
```

Provides the command `js-yaml`.

## Health

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

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

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 5.4.2 |
| Published | 2026-09-13 |
| First published | 2011-11-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 1.5 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6635 |
| Author | Vladimir Zapparov |
| Maintainers | vitaly |
| Keywords | yaml, parser, serializer, pyyaml |

## Links

- npm: https://www.npmjs.com/package/js-yaml
- Repository: https://github.com/nodeca/js-yaml
- Homepage: https://github.com/nodeca/js-yaml#readme
- Issues: https://github.com/nodeca/js-yaml/issues
- Funding: https://github.com/sponsors/puzrin
- npm.io page: https://npm.io/package/js-yaml

## Dependencies (1)

- [argparse](https://npm.io/package/argparse.md) ^2.0.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

- 5.4.2 (latest) — 2026-09-13
- 3.15.2 (v3-legacy) — 2026-08-26
- 4.3.2 (v4-legacy) — 2026-08-26
- 5.4.1 — 2026-08-26
- 5.4.0 — 2026-08-25
- 5.3.0 — 2026-08-14
- 5.2.3 — 2026-08-01
- 3.15.1 — 2026-07-31
- 4.3.1 — 2026-07-31
- 5.2.2 — 2026-07-23
- 5.2.1 — 2026-07-02
- 3.15.0 — 2026-06-26
- 4.3.0 — 2026-06-26
- 5.2.0 — 2026-06-26
- 5.1.0 — 2026-06-22
- … 76 more at https://npm.io/package/js-yaml/versions

## README

# js-yaml

[![CI](https://github.com/nodeca/js-yaml/actions/workflows/ci.yml/badge.svg)](https://github.com/nodeca/js-yaml/actions/workflows/ci.yml)
[![NPM version](https://img.shields.io/npm/v/js-yaml.svg)](https://www.npmjs.org/package/js-yaml)

> YAML 1.2 parser and serializer for JavaScript.

__[Online demo](https://nodeca.github.io/js-yaml/)__

- Supports the YAML 1.2 and YAML 1.1 specifications.
- Passes the entire [YAML Test Suite](https://github.com/yaml/yaml-test-suite).


### [Documentation >>](https://nodeca.github.io/js-yaml/doc/)


##### Install

```bash
npm install js-yaml
```


##### Usage

```js
import { load } from 'js-yaml'

try {
  const document = load('greeting: hello')
  console.log(document.greeting)
} catch (e) {
  console.error(e)
}
```

```js
import { dump } from 'js-yaml'

const source = dump({ greeting: 'hello' })
console.log(source)
```

[More usage examples](docs/usage.md).

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