Skip to content

Instantly share code, notes, and snippets.

@heapwolf
Created May 18, 2011 00:15
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save heapwolf/977742 to your computer and use it in GitHub Desktop.
Save heapwolf/977742 to your computer and use it in GitHub Desktop.
accepting input from a pipe, nodejs
var data;
process.stdin.resume();
process.stdin.setEncoding('utf8');
process.stdin.on('data', function(chunk) {
data += chunk;
});
process.stdin.on('end', function() {
callback(data)
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment