Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/ad-si/yaml2json
- Owner: ad-si
- Created: 2015-10-25T19:23:45.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2020-04-26T18:56:22.000Z (almost 5 years ago)
- Last Synced: 2024-09-19T19:44:09.934Z (5 months ago)
- Topics: cli, converter, json, yaml, yaml2json
- Language: JavaScript
- Size: 11.7 KB
- Stars: 6
- Watchers: 3
- 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)
```