Skip to content

Instantly share code, notes, and snippets.

@anandology
Created November 4, 2010 09:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anandology/662280 to your computer and use it in GitHub Desktop.
Save anandology/662280 to your computer and use it in GitHub Desktop.
node.js script to process JSON strings one per each line.
#!/usr/bin/env node
var carrier = require('carrier');
var stdin = process.openStdin();
stdin.setEncoding('utf8');
carrier.carry(stdin, function(line) {
var body = JSON.parse(line);
eval(process.argv[2]);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment