rafting

A way to group multiple writable streams together to pipe or write to simultaneously

node-rafting

A way to group multiple writable streams together to pipe or write to simultaneously

example

var rafting = require('rafting')
  , fs = require('fs')
  ;
 
var stream = rafting.createWriteStream(outstreamA, outstreamB)
    
instream.pipe(stream)

instream will be piped to outstreamA and outstreamB. For a more detailed example checkout the example directory.

API

Creates a CompositeStream object wrapping all the writable streams passed to it.

Pushes an additional stream to the CompositeStream object.

Calls each contained stream own write method. Returns false if any one of the streams could not flush the buffer to the kernel.

Calls the end method for each of the contained stream. Turns the stream writable flag off.

function () {}

After a write returned false, emitted once only after all contained streams had emitted the drain event.

function (exception, [stream]) {}

Emitted on error with exception. If the error was emitted by a contained stream, stream argument will be that stream, otherwise it will be null.

install

npm install rafting

license

MIT