🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

stream-buffer

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stream-buffer

Buffer a stream and replay data at any time

1.0.0
latest
npm
Version published
Weekly downloads
8
-27.27%
Maintainers
1
Weekly downloads
 
Created
Source

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

Keywords

stream

FAQs

Package last updated on 17 Oct 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts