@adius/yaml2json

A stream transformer to convert YAML to JSON.

Usage no npm install needed!

<script type="module">
  import adiusYaml2json from 'https://cdn.skypack.dev/@adius/yaml2json';
</script>

README

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)