Socket
Socket
Sign inDemoInstall

stream-buffer

Package Overview
Dependencies
1
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    stream-buffer

Buffer a stream and replay data at any time


Version published
Weekly downloads
1
decreased by-85.71%
Maintainers
1
Install size
15.2 kB
Created
Weekly downloads
 

Readme

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

FAQs

Last updated on 17 Oct 2013

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc