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: 5 days ago
JSON representation
A stream transformer to convert YAML to JSON
- Host: GitHub
- URL: https://github.com/ad-si/yaml2json
- Owner: ad-si
- Created: 2015-10-25T19:23:45.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2020-04-26T18:56:22.000Z (over 5 years ago)
- Last Synced: 2025-09-02T14:51:16.456Z (about 1 month ago)
- Topics: cli, converter, json, yaml, yaml2json
- Language: JavaScript
- Size: 11.7 KB
- Stars: 6
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
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)
```