Skip to content

Instantly share code, notes, and snippets.

@chaiwa-berian
Last active August 20, 2018 17:49
Show Gist options
  • Save chaiwa-berian/289699983fc0b005acff922bf54ab2c7 to your computer and use it in GitHub Desktop.
Save chaiwa-berian/289699983fc0b005acff922bf54ab2c7 to your computer and use it in GitHub Desktop.
var Readable = require('stream').Readable;
var rs = new Readable;
rs.push('beep');
rs.push('boop\n');
rs.push(null); //Tells the consumer that rs is done outputting data
rs.pipe(process.stdout);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment