Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
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

  • 0.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
48K
decreased by-13.37%
Maintainers
1
Weekly downloads
 
Created
Source

bubble-stream-error

Description

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

Examples

var bubbleError = require('../bubble').bubble,
    fs          = require('fs'),
    zlib        = require('zlib'),
    stream      = require('stream'),
    readStream, compressStream, myStream;

readStream     = fs.createReadStream(__filename);
compressStream = zlib.createGzip();

// just a sample stream
myStream        = new require('stream').Writable();
myStream._write = function(chunk, enc, next) { next(); };

myStream.on('error', function(err) {
  console.log('myStream error:', err.message);
});

bubbleError(myStream, [readStream, compressStream]);

readStream.pipe(compressStream).pipe(myStream);

compressStream.once('data', function() {
  this.emit('error', new Error('error emitted on compressStream'));
});

// you can test also on the readStream by uncommenting below
/*
readStream.once('data', function() {
  this.emit('error', new Error('error emitted on readStream'));
});
*/

Tests

npm test

License

MIT.

Keywords

FAQs

Package last updated on 01 Jul 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

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc