Skip to content

Instantly share code, notes, and snippets.

@attomos
Created April 28, 2014 12:00
Show Gist options
  • Select an option

  • Save attomos/11369741 to your computer and use it in GitHub Desktop.

Select an option

Save attomos/11369741 to your computer and use it in GitHub Desktop.
#!/usr/bin/env node
// From http://stackoverflow.com/a/16351842/606355
var stdin = process.openStdin();
var data = "";
stdin.on('data', function(chunk) {
data += chunk;
});
stdin.on('end', function() {
console.log(data);
// console.log("DATA:\n" + data + "\nEND DATA");
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment