Created
February 17, 2014 16:15
-
-
Save adohe-zz/9053593 to your computer and use it in GitHub Desktop.
readable stream implementation in Node.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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