good tool for indenting JavaScript files [closed]
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this questionCan you suggest any tool to re indent minified JavaScript files and compressed CSS files?
hi I guess you mean beautify it ,
for javascript : http://jsbeautifier.org/
for css : http://www.codebeautifier.com/
I like this website for reformatting/prettifying CSS:
http://procssor.com/
I use Chrome for daily development now...if you're in the same boat, the PrettyPrint extension is excellent for this.
You get indentation and syntax highlighting to make it much easier to read. Even better, just clicking the minified file link from view-source (or going directly...any way you navigate to it works) gets you there, no copy/paste steps involved.
Closure Compiler will do it for JS. Set "Optimization" to "Whitespace only" and check the "Pretty print" box. For CSS, the CSS tab of Firebug (with no other add-ons) seems to work reasonably well, although saving the beautified code by copy-and-pasting is slightly difficult but possible (you have to use the keyboard, and then re-indent the copied lines in a text editor).
Altough maybe overkill for this task, many IDEs can reformat minified JavaScript. E.g. IntelliJ IDEA where you can use the menu element Code -> Reformat Code... The free version of IntelliJ will suffice. I guess Jetbrains simpler IDE for HTML/JavaScript development, Webstorm, can do this as well, as well as other IDEs like Eclipse and NetBeans
If you use Firefox with Firebug you may install Yslow: it has some good tools like "All JS Beautified" and "All CSS Beautified". You will like it =)
See our SD Formatter for ECMAScript.
精彩评论