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

bubble-stream-error

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bubble-stream-error

Bubble errors from an array of streams to a master/top stream

1.0.0
latest
Source
npm
Version published
Weekly downloads
85K
-9.76%
Maintainers
1
Weekly downloads
 
Created
Source

bubble-stream-error

Node module for bubbling errors from 'sub-streams' to a master stream.

build status

examples

This is what you would normally do:

randomStream.pipe(colorizeStream).pipe(choppedStream).pipe(finalStream);

// assign an error handler on each stream
[randomStream, colorizeStream, choppedStream, finalStream].forEach(function(stream) {
  stream.on('error', function handleError(err) {
    // ...
  });
});

With bubble-stream-error:

var bubbleError = require('bubble-stream-error');

// ...

bubbleError(randomStream, colorizeStream, choppedStream, finalStream);
randomStream.pipe(colorizeStream).pipe(choppedStream).pipe(finalStream);

// assign a single error handler instead of 4
finalStream.on('error', function handleAllStreamErrors(err) {
  // ...
});

tests

npm test

License

MIT

Keywords

bubble

FAQs

Package last updated on 26 Nov 2015

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