Skip to content
intersperse stream chunks with separators
JavaScript
Latest commit cdc8fe6 Oct 2, 2012 @substack using travis
Failed to load latest commit information.
example reworked example slightly Oct 2, 2012
test
.travis.yml using travis Oct 2, 2012
LICENSE package.json and some deps Oct 2, 2012
index.js initial implementation Oct 2, 2012
package.json package.json and some deps Oct 2, 2012
readme.markdown using travis Oct 2, 2012

readme.markdown

join-stream

Intersperse stream chunks with separators.

build status

example

var joinStream = require('join-stream');
var split = require('event-stream').split;

process.stdin
    .pipe(split())
    .pipe(joinStream(','))
    .pipe(process.stdout)
;
$ echo -e 'abc\ndef\nhi\njkl' | node example/comma.js
abc,def,hi,jkl

methods

var joinStream = require('join-stream')

joinStream(sep='\n', opts={})

Return a through stream that inserts the string or buffer separator sep between 'data' chunks.

If opts.end is truthy, insert the separators immediately after 'data' events are received and add a separator after the last element. Otherwise add the separators only after the next element has been received and don't add a separator after the last element.

install

With npm do:

npm install join-stream

license

MIT

Something went wrong with that request. Please try again.