1.0.1 • Published 4 years ago

@adius/yaml2json v1.0.1

Weekly downloads
328
License
MIT
Repository
github
Last release
4 years ago

YAML2JSON

A stream transformer to convert YAML to JSON.

Installation

npm install --save @adius/yaml2json

Usage

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)