event-stream
Advanced tools
Comparing version 3.0.7 to 3.0.8
49
index.js
@@ -14,3 +14,4 @@ //filter will reemit the data if cb(err,pass) pass is truthy | ||
, pause = require('pause-stream') | ||
, split = require('split') | ||
, split = require('split') | ||
, pipeline = require('stream-combiner') | ||
@@ -24,3 +25,3 @@ es.Stream = Stream //re-export Stream from core | ||
es.split = split | ||
es.pipeline = es.connect = es.pipe = pipeline | ||
// merge / concat | ||
@@ -131,3 +132,4 @@ // | ||
es.readable = function (func, continueOnError) { | ||
es.readable = | ||
function (func, continueOnError) { | ||
var stream = new Stream() | ||
@@ -185,3 +187,2 @@ , i = 0 | ||
// | ||
@@ -212,43 +213,3 @@ // map sync | ||
// | ||
// combine multiple streams together so that they act as a single stream | ||
// | ||
es.pipeline = | ||
es.pipe = es.connect = function () { | ||
var streams = [].slice.call(arguments) | ||
, first = streams[0] | ||
, last = streams[streams.length - 1] | ||
, thepipe = es.duplex(first, last) | ||
if(streams.length == 1) | ||
return streams[0] | ||
else if (!streams.length) | ||
throw new Error('connect called with empty args') | ||
//pipe all the streams together | ||
function recurse (streams) { | ||
if(streams.length < 2) | ||
return | ||
streams[0].pipe(streams[1]) | ||
recurse(streams.slice(1)) | ||
} | ||
recurse(streams) | ||
function onerror () { | ||
var args = [].slice.call(arguments) | ||
args.unshift('error') | ||
thepipe.emit.apply(thepipe, args) | ||
} | ||
//es.duplex already reemits the error from the first and last stream. | ||
//add a listener for the inner streams in the pipeline. | ||
for(var i = 1; i < streams.length - 1; i ++) | ||
streams[i].on('error', onerror) | ||
return thepipe | ||
} | ||
// | ||
@@ -255,0 +216,0 @@ // child -- pipe through a child process |
{ | ||
"name": "event-stream", | ||
"version": "3.0.7", | ||
"version": "3.0.8", | ||
"description": "construct pipes of streams of events", | ||
@@ -11,3 +11,2 @@ "homepage": "http://github.com/dominictarr/event-stream", | ||
"dependencies": { | ||
"optimist": "0.2", | ||
"through": "1.1.0", | ||
@@ -18,3 +17,4 @@ "duplexer": "~0.0.2", | ||
"pause-stream": "0.0.4", | ||
"split": "0.0.0" | ||
"split": "0.0.0", | ||
"stream-combiner": "0.0.0" | ||
}, | ||
@@ -21,0 +21,0 @@ "devDependencies": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
39632
1057
+ Addedstream-combiner@0.0.0
+ Addedduplexer@0.0.2(transitive)
+ Addedstream-combiner@0.0.0(transitive)
- Removedoptimist@0.2
- Removedoptimist@0.2.8(transitive)
- Removedwordwrap@0.0.3(transitive)