Skip to content

Instantly share code, notes, and snippets.

@adohe-zz
Created February 17, 2014 16:15
Show Gist options
  • Select an option

  • Save adohe-zz/9053593 to your computer and use it in GitHub Desktop.

Select an option

Save adohe-zz/9053593 to your computer and use it in GitHub Desktop.
readable stream implementation in Node.js
var stream = require('stream');
var s = new Stream;
s.readable = true;
VS:
var stream = require('stream');
var Readable = stream.Readable;
var util = require('util');
function MyReadable(options) {
if(!(this instanceof MyReadable)) {
return new MyReadable(options);
}
Readable.call(this);
}
util.inherits(MyReadable, Readable);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment