Skip to content

Instantly share code, notes, and snippets.

@mixu
Created May 24, 2012 18:20
Show Gist options
  • Save mixu/2783272 to your computer and use it in GitHub Desktop.
Save mixu/2783272 to your computer and use it in GitHub Desktop.
Formatting JSON from stdin using Node
Pipe curl to:
node -e 'var d = "", p=process.stdin; p.resume(); p.on("data", function(c){d+=c;}); p.on("end", function(){ console.log(require("util").inspect(JSON.parse(d), false, null, true))})'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment