Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
var Readable = require('stream').Readable;
var r = new Readable({ lowWaterMark: 0 });
r._read = function (bytes, done) {
console.error('read %d bytes', bytes);
done(null, Buffer('test'));
};
r.on('readable', function () {
console.error('readable event');
});
// unnecessary hack?
//r.read(0);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.