Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ad-si/yaml2json

A stream transformer to convert YAML to JSON
https://github.com/ad-si/yaml2json

cli converter json yaml yaml2json

Last synced: 2 months ago
JSON representation

A stream transformer to convert YAML to JSON

Awesome Lists containing this project

README

        

# YAML2JSON

A stream transformer to convert YAML to JSON.

## Installation

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

## Usage

```js
const Yaml2json = require('@adius/yaml2json')

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