Skip to content

Instantly share code, notes, and snippets.

@joshuakfarrar
Created March 27, 2014 16:13
Show Gist options
  • Save joshuakfarrar/9811293 to your computer and use it in GitHub Desktop.
Save joshuakfarrar/9811293 to your computer and use it in GitHub Desktop.
var buffers = [];
process.stdin.on('readable', function(chunk) {
var chunk = process.stdin.read();
if (chunk !== null) {
buffers.push(chunk);
}
});
process.stdin.on('end', function() {
console.log(Buffer.concat(buffers));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment