# @adius/yaml2json

> A stream transformer to convert YAML to JSON.

Latest version **2.0.0** (published 2026-05-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install @adius/yaml2json
pnpm add @adius/yaml2json
yarn add @adius/yaml2json
bun add @adius/yaml2json
```

Provides the command `yaml2json`.

## Health

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

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

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2026-05-11 |
| First published | 2015-10-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=20 |
| Dependencies | 1 |
| Unpacked size | 6.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Adrian Sieber |
| Maintainers | adius |
| Keywords | yaml2json, yaml, json, stream, typescript |

## Links

- npm: https://www.npmjs.com/package/@adius/yaml2json
- Repository: https://github.com/ad-si/yaml2json
- Homepage: https://github.com/ad-si/yaml2json#readme
- Issues: https://github.com/ad-si/yaml2json/issues
- npm.io page: https://npm.io/package/@adius/yaml2json

## Dependencies (1)

- [js-yaml](https://npm.io/package/js-yaml.md) ^4.1.0

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 2.0.0 (latest) — 2026-05-11
- 1.0.1 — 2020-04-26
- 1.0.0 — 2020-04-26
- 0.1.2 — 2015-10-26
- 0.1.1 — 2015-10-25
- 0.1.0 — 2015-10-25

## README

# YAML2JSON

A stream transformer to convert YAML to JSON.


## Installation

```sh
npm install @adius/yaml2json
```


## Usage

```ts
import { createReadStream } from "node:fs"
import { Transform } from "node:stream"
import { Yaml2json } from "@adius/yaml2json"

createReadStream("path/to/some/file.yaml")
  .pipe(new Yaml2json())
  .pipe(new Transform({
    writableObjectMode: true,
    transform: (chunk, _encoding, done) =>
      done(null, JSON.stringify(chunk) + "\n"),
  }))
  .pipe(process.stdout)
  .on("error", console.error)
```


## CLI

```sh
cat file.yaml | yaml2json
```

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