Created
December 9, 2014 15:21
-
-
Save stuwilli/0cc81d24f128d26fc3a8 to your computer and use it in GitHub Desktop.
js-beautify BBEdit Text Filter
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/local/bin/node | |
var beautify; | |
try { | |
beautify = require("/usr/local/lib/node_modules/js-beautify").js_beautify; | |
} catch(e) { | |
console.error("js-beautify is not found"); | |
process.exit(e.code); | |
} | |
process.stdin.resume(); | |
process.stdin.setEncoding('utf8'); | |
process.stdin.on('data', function (chunk) { | |
//process.stdout.write(encodeURIComponent(chunk)); | |
process.stdout.write(beautify(chunk, { indent_size: 4, indent_char: " " })); | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment