You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 5, 2019. It is now read-only.
/Users/joemccann/Documents/workspace/split/examples/pretty.js:8
es.split(), //split stream to break on newlines
^
TypeError: Object function split(matcher, mapper) {
var soFar = ''
if('function' === typeof matcher)
mapper = matcher, matcher = null
if (!matcher)
matcher = '\n'
return through(function (buffer) {
var stream = this
, pieces = (soFar + buffer).split(matcher)
soFar = pieces.pop()
for (var i = 0; i < pieces.length; i++) {
var piece = pieces[i]
if(mapper) {
piece = mapper(piece)
if('undefined' !== typeof piece)
stream.queue(piece)
}
else
stream.queue(piece)
}
},
function () {
if(soFar)
this.queue(soFar)
this.queue(null)
})
} has no method 'split'
at Object.<anonymous> (/Users/joemccann/Documents/workspace/split/examples/pretty.js:8:8)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:901:3
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
7 219k 7 17184 0 0 30263 0 0:00:07 --:--:-- 0:00:07 186k
curl: (23) Failed writing body (0 != 1448)
Quite possible I'm doing it wrong but:
curl -sS registry.npmjs.org/event-stream | node pretty.jsGives the following:
This is node 0.10.2, btw...