Skip to content

Instantly share code, notes, and snippets.

@garthk
Created February 28, 2014 04:04
Show Gist options
  • Select an option

  • Save garthk/9265037 to your computer and use it in GitHub Desktop.

Select an option

Save garthk/9265037 to your computer and use it in GitHub Desktop.

Revisions

  1. garthk created this gist Feb 28, 2014.
    9 changes: 9 additions & 0 deletions _readnoop.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    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);