Socket
Socket
Sign inDemoInstall

delayed-stream

Package Overview
Dependencies
0
Maintainers
0
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

delayed-stream

TBD


Version published
Maintainers
0
Weekly downloads
37,750,499
decreased by-7.79%

Weekly downloads

Package description

What is delayed-stream?

The delayed-stream package is a Node.js module that allows you to buffer a stream and release it only when you decide to. This can be useful when you need to collect data from a stream before processing it, or when you want to ensure that a stream's data is only consumed after a certain event or condition is met.

What are delayed-stream's main functionalities?

Create a delayed stream

This feature allows you to create a delayed stream from an existing readable stream. The data from the original stream is buffered until you decide to release it, for example, using a timeout as shown in the code sample.

const DelayedStream = require('delayed-stream');
const fs = require('fs');

const source = fs.createReadStream('source.txt');
const delayed = DelayedStream.create(source);

// You can now wire up event listeners
source.on('data', function(data) {
  console.log('Received data: ' + data);
});

// And later, release the buffered data
setTimeout(function() {
  delayed.pipe(process.stdout);
}, 5000);

Other packages similar to delayed-stream

FAQs

Last updated on 22 May 2011

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