stream-buffer
Buffer a stream and replay data at any time
Last updated 7 years ago by parshap .
Public Domain · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install stream-buffer 
SYNC missed versions from official npm registry.

stream-buffer

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.

Example

var buffer = require("buffer");
var stream = require("fs")
	.createReadStream("file")
	.pipe(buffer());

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
	stream.replay(require("fs").createWriteStream("file"));
}, 100);

Installation

npm install stream-buffer

Current Tags

  • 1.0.0                                ...           latest (7 years ago)

1 Versions

  • 1.0.0                                ...           7 years ago
Maintainers (1)
Downloads
Today 0
This Week 1
This Month 2
Last Day 0
Last Week 0
Last Month 1
Dependencies (1)
Dev Dependencies (1)

Copyright 2014 - 2017 © taobao.org |