simple-jsonstream

0.2.0 • Public • Published

simple-jsonstream

A simple transform stream to output a valid JSON array

Need to output a stream of objects as a JSON array?

var JSONStream = require('simple-jsonstream');
 
var jsonStream = myAwesomeObjectStream.pipe(new JSONStream());
 
// In hapi route handler
reply(jsonStream).type('application/json');
 
// In express
res.setHeader('content-type', 'application/json');
jsonStream.pipe(res);

Acknowledgements:

This approach was mostly borrowed from a gist by @nlf

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.2.0
    6
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.2.0
    6
  • 0.1.0
    3

Package Sidebar

Install

npm i simple-jsonstream

Weekly Downloads

7

Version

0.2.0

License

MIT

Last publish

Collaborators

  • aaronmccall