Skip to content

Instantly share code, notes, and snippets.

@JoshuaGross
Created April 6, 2016 23:03
Show Gist options
  • Save JoshuaGross/70b65c32a7ef911f3e12bd2ad6b18ad1 to your computer and use it in GitHub Desktop.
Save JoshuaGross/70b65c32a7ef911f3e12bd2ad6b18ad1 to your computer and use it in GitHub Desktop.
Process JSON on the command-line with Node
echo "{ \"param\": 234 }" | node -e 'var input = ""; process.stdin.on("data", function (d) { input += d.toString(); }); process.stdin.on("close", function () { console.log(JSON.parse(input).param); });'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment