Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Generated on Apr 25, 2024 via pnpm

delayed-stream 1.0.0

Buffers events from a stream until you are ready to handle them.
Package summary
Share
0
issues
1
license
1
MIT
Package created
22 May 2011
Version published
30 Apr 2015
Maintainers
2
Total deps
1
Direct deps
0
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
delayed-stream@1.0.0
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

0
All Dependencies CSV
β“˜ This is a list of delayed-stream 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities

Visualizations

Frequently Asked Questions

What does delayed-stream do?

Delayed-stream is a Node.js module that provides functionality for buffering events from a stream until you are ready to handle them. This can be beneficial in cases where events are fired faster than they can be handled, thus preventing data loss and maintaining system stability.

How do you use delayed-stream?

Using delayed-stream is straightforward and intuitive. To start with, you'll need to install it using npm:

npm install delayed-stream

Then, simply require the module and use it in your code. For example, consider the case of an HTTP echo server delaying its response by 1000 milliseconds:

var DelayedStream = require('delayed-stream');
var http = require('http');

http.createServer(function(req, res) {
  var delayed = DelayedStream.create(req);

  setTimeout(function() {
    res.writeHead(200);
    delayed.pipe(res);
  }, 1000);
});

Additionally, if you're not using Stream#pipe, you can manually release the buffered events by calling delayedStream.resume():

var delayed = DelayedStream.create(req);

setTimeout(function() {
  // Emit all buffered events and resume underlaying source
  delayed.resume();
}, 1000);

Where are the delayed-stream docs?

The documentation for delayed-stream can be found directly within the "readme" file of its GitHub repository. The readme provides a thorough explanation of the module's implementation, usage examples, API descriptions and information on error handling and buffer limits. Comprehensive and detailed, it's a valuable resource for understanding and utilizing delayed-stream effectively.