Buffer a stream and replay data at any time

npm install stream-buffer
1 downloads in the last week
21 downloads in the last month


Create a writable stream that will save all data written to a buffer. The buffer can be "replayed" into another writable stream at any time.

The buffer stream will have a stream.replay() method which works like stream.pipe() but will re-write all data regardless of when the function is called.


var buffer = require("buffer");
var stream = require("fs")

setTimeout(function() {
    // At any time ...
    // Replay the buffer into another writable stream and receive all
    // data events from the very first one to the "end" event
}, 100);


npm install stream-buffer
npm loves you