never-ending-stream
Automatically restarts your stream for you when it ends. This can be easily use to concatenate multiple streams.
Usage
'use strict' var nes = var from = var chunks = 'hello' 'world'var count = 0 var stream = // prints// hello// world// hello// worldstream
API
neverEndingStream([opts,] build([cb]))
Creates a binary never-ending stream, by concatenating all streams
generated by build
. build
is called whenever the
previous stream completes.
build
can be synchronous or asynchronous:
-
if it accepts no callback, is synchronous, and it should return the stream, or
null
to close thenever-ending-stream
. -
if it accepts a callback, is asynchronous, and you should call the callback when the next stream is ready, like
cb(null, stream)
.
All other options will be passed to through2.
neverEndingStream.obj([opts, ], build([cb]))
Like neverEndingStream()
, but with objectMode: true
by default.
License
MIT