Created
May 15, 2014 16:18
-
-
Save lkptrzk/c32e95b0e3df078e2f8d to your computer and use it in GitHub Desktop.
pretty print json from stdin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
var concat = require('concat-stream'); | |
process.stdin.pipe(concat(function (data) { | |
var json = JSON.parse(data); | |
var str = JSON.stringify(json, null, 2); | |
console.log(str); | |
})); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment