UNPKG

highland-errors-to

Version:

Redirect errors in a highland stream.

21 lines (17 loc) 351 B
var _ = require('highland'); /** * errorsTo * * Redirect errors in a highland stream. * * @param stream * @return */ module.exports = function errorsTo(stream) { var errorStream = stream.observe().filter(function() { return false; }); stream = stream.errors(function() {}); return { stream: stream, errors: errorStream }; };