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

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i simple-jsonstream

      Weekly Downloads

      1

      Version

      0.2.0

      License

      MIT

      Last publish

      Collaborators

      • aaronmccall