📅 You're Invited: Meet the Socket team at RSAC (April 28 – May 1).RSVP
Socket
Sign inDemoInstall
Socket

highland-errors-to

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

highland-errors-to

Redirect errors in a highland stream.

1.0.1
npm
Version published
Weekly downloads
1.8K
-15.24%
Maintainers
1
Weekly downloads
 
Created
Source

Highland Errors To

Redirect errors in a highland stream.

Install

npm install highland-errors-to

Usage

var _ = require('highland'),
    errorsTo = require('highland-errors-to'),
    stream,
    errorStream;

stream = _(function(push, next) {
  push(null, 'hello');
  push(new Error('first error'));
  push(null, 'everyone');
  push(new Error('second error'));
  push(null, _.nil);
});

errorStream = _();

stream = stream.consume(errorsTo(errorStream));

stream
  .errors(function(error, push) {
    // never called, all errors are redirected!
  });

errorStream
  .errors(function(error, push) {
    // called for every error in stream
  });

stream.resume();
errorStream.resume();

Keywords

highland

FAQs

Package last updated on 11 Feb 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