Skip to content

Instantly share code, notes, and snippets.

@garthk
Created February 28, 2014 04:04
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save garthk/9265037 to your computer and use it in GitHub Desktop.
Save garthk/9265037 to your computer and use it in GitHub Desktop.
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);
@changjie-lin
Copy link

Thank you for posting this answer on stackoverflow.

@shinout
Copy link

shinout commented Feb 25, 2016

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment