event-stream
Advanced tools
Comparing version 1.3.0 to 1.3.1
24
index.js
@@ -51,3 +51,13 @@ //filter will reemit the data if cb(err,pass) pass is truthy | ||
end.call(this) | ||
stream.destroy() | ||
} | ||
/* | ||
destroy is called on a writable stream when the upstream closes. | ||
it's basically END but something has gone wrong. | ||
I'm gonna emit 'close' and change then otherwise act as 'end' | ||
*/ | ||
stream.destroy = function () { | ||
stream.emit('close') | ||
ended = true | ||
} | ||
stream.pause = function () { | ||
@@ -227,2 +237,7 @@ stream.paused = true | ||
} | ||
stream.destroy = function () { | ||
stream.emit('close') | ||
stream.emit('end') | ||
ended = true | ||
} | ||
return stream | ||
@@ -321,8 +336,7 @@ } | ||
es.log = function (name) { | ||
return es.map(function () { | ||
return es.through(function (data) { | ||
var args = [].slice.call(arguments) | ||
var cb = args.pop() | ||
console.error.apply(console, name ? [name].concat(args) : args) | ||
args.unshift(null) | ||
cb.apply(null, args) | ||
if(name) console.error(name, data) | ||
else console.error(data) | ||
this.emit('data', data) | ||
}) | ||
@@ -329,0 +343,0 @@ } |
{ "name": "event-stream" | ||
, "version": "1.3.0" | ||
, "version": "1.3.1" | ||
, "description": "construct pipes of streams of events" | ||
@@ -4,0 +4,0 @@ , "homepage": "http://github.com/dominictarr/event-stream" |
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
44937
1151