Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 5c1fb7c705
Fetching contributors…

Cannot retrieve contributors at this time

58 lines (40 sloc) 1.207 kb

gutter

Streaming JSON.stringify() for nested streams

build status

example

var gutter = require('gutter');
var fs = require('fs');

var out = gutter({
    name : 'words',
    words : fs.createReadStream('/usr/share/dict/words', { encoding : 'utf8' }),
    passwd : fs.createReadStream('/etc/passwd', { encoding : 'utf8' }),
    beep : 'boop'
});

out.pipe(process.stdout);

methods

var gutter = require('gutter');

gutter(object)

Return a new json stream with stringify output from the json object object. Any streams nested inside of object will be read and output as data becomes available.

If there are multiple streams in object, the others will get paused and buffered while waiting for each stream to finish.

Streams are treated as arrays with new elements for every 'data' event. To emit a streaming object using JSONStream .stringifyStream(), set stream.type = 'object'.

install

With npm do:

npm install gutter

license

MIT/X11

Jump to Line
Something went wrong with that request. Please try again.