Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

streaming JSON.stringify() for nested streams

tree: 5c1fb7c705

Fetching latest commit…

Cannot retrieve the latest commit at this time

README.markdown

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

Something went wrong with that request. Please try again.