You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

yaml-document-stream

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

yaml-document-stream

Work with multi-document YAML as stream


Version published
Maintainers
1
Created

Readme

Source

YAML multi-document as stream

This is parser/generator for YAML containing multiple documents as streams.

Installation

npm -i yaml-document-stream

js-yaml is a peer dependency, make sure to add it also if not installed already.

Usage

Convert YAML stream, to stream of parsed objects

  // See example.read.js for full source

  fs.createReadStream('file.yaml').pipe(
    new YamlStreamReadTransformer()
  )

Convert stream of objects, to YAML multi-document

  // See example.write.js for full source

  stream.Readable.from([{d:1}, {d:2}], {
    objectMode: true,
  }).pipe(
    new YamlStreamWriteTransformer()
  ).pipe(
    process.stdout
  )

Note

This is not a full streaming parser for YAML, only splitting documents is done in streaming fashion, the single document parsing is done via js-yaml

Keywords

FAQs

Package last updated on 29 Jan 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc