Skip to content

Instantly share code, notes, and snippets.

@ku
Created April 18, 2014 11:40
Show Gist options
  • Save ku/11039482 to your computer and use it in GitHub Desktop.
Save ku/11039482 to your computer and use it in GitHub Desktop.
json parser
#!/usr/bin/env node
var json = ''
process.stdin.on('readable', function(chunk) {
var chunk = process.stdin.read();
json += chunk
if (chunk !== null) {
var r = JSON.parse(json)
r = JSON.stringify(r, null, ' ');
console.log(r);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment