免責聲明

Disclaimer (免責聲明)
繼續閱覽代表您接受以上的免責聲明.
To continue reading means you accept the above disclaimer.

2015年4月16日 星期四

js code re-format, beautify


//== http://stackoverflow.com/questions/18985/what-javascript-code-beautifier-can-i-use-via-the-command-line-on-windows-and-li


//=== http://jsbeautifier.org/
* jsbeautifier source code is free and open, available on the github under MIT licence,
https://github.com/beautify-web/js-beautify

* jsbeautifier also has a command-line version (need V8?),
python library and a node package as well.




//=== uglify-js under nodejs

$ sudo npm install -g uglify-js

$ uglifyjs foo.js --beautify --output cutefoo.js

uglify uses spaces for indentation by default
to convert the 4-space-indentation to tab
$ unexpand --tabs=4 cutefoo.js > cuterfoo.js



//=== uncrustify?
http://uncrustify.sourceforge.net/



沒有留言:

張貼留言