select-stream
v0.1.0
Published
Filter an object stream with a callback.
Downloads
3
Readme
select-stream
Filter an object stream with a callback.
Examples
var SelectStream = require('select-stream');
var sstream = new SelectStream(function(msg) {
return msg.name === 'foobar';
});
var bad = { name: 'snafu' };
var good = { name: 'foobar' };
sstream.write(bad);
sstream.write(good);
var output = sstream.read();
test.deepEqual(good, output); // true