Noiseless Praying Mantis
    Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

    simple-jsonstreampublic

    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

    install

    npm i simple-jsonstream

    Downloadsweekly downloads

    6

    version

    0.2.0

    license

    MIT

    repository

    githubgithub

    last publish

    collaborators

    • avatar