Created
October 19, 2015 19:03
-
-
Save rgamez/507eb51fca4c48994d21 to your computer and use it in GitHub Desktop.
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 | |
// Usage cat records.json | ./json_by_lines.js | |
var readline = require('readline'); | |
var rl = readline.createInterface({ | |
input: process.stdin | |
}); | |
rl.on('line', function (line) { | |
console.log(JSON.stringify(JSON.parse(line.trim()), null, ' ') + ','); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment