sse-parse-stream
v0.1.0
Published
duplex stream to parse sse
Downloads
2
Readme
sse-parse-stream
duplex stream to parse sse.
example
var parse = require('sse-parse-stream'),
through = require('through2'),
tr = through();
tr
.pipe(parse())
.pipe(through.obj(function (row, enc, cb) {
console.log(row);
cb();
}));
tr.write('event: sup\ndata: { "x": "555" }\n\n');
generates:
[ 'sup', { x: '555' } ]
api
var parse = require('sse-parse-stream')
var parser = parse()
Returns a duplex stream that takes in event stream text and produces rows of [event, data]
pairs.
license
mit