Created
June 16, 2012 23:04
-
-
Save prasmussen/2942753 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/node | |
var args = process.argv; | |
if (args.length < 3) { | |
console.log("Usage: " + args[1] + " <text file>"); | |
process.exit(1); | |
} | |
fs = require('fs'); | |
fs.readFile(args[2], function(err, data) { | |
if (err) { | |
console.log(err); | |
process.exit(1); | |
} | |
json = JSON.stringify(data.toString()); | |
console.log(json); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment