Created
February 28, 2014 04:04
-
-
Save garthk/9265037 to your computer and use it in GitHub Desktop.
This file contains 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'); | |
function streamify(text) { | |
var s = new stream.Readable(); | |
s.push(text); | |
s.push(null); | |
return s; | |
} | |
streamify('foo\n').pipe(process.stdout); |
Thank you for posting this answer on stackoverflow.
+1
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Usage:
node _readnoop
Expected result: the same crash as if you'd done this in the REPL:
Actual result in Node v0.10.26: