Skip to content

junosuarez/join-stream2

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

join-stream2

Intersperse stream chunks with separators.

build status

forked from substack/join-stream for streams2 support.

example

var joinStream = require('join-stream2');
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-stream2')

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-stream2

license

MIT

About

intersperse stream chunks with separators

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%