views:

190

answers:

7

Hi All,

Can you suggest any tool to re indent minified JavaScript files and compressed CSS files?

+11  A: 

hi I guess you mean beautify it ,

  1. for javascript : http://jsbeautifier.org/

    for css : http://www.codebeautifier.com/

tawfekov
nice tools. thanks
gov
+1  A: 

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

rlovtang
+4  A: 

I like this website for reformatting/prettifying CSS:

http://procssor.com/

John Catterfeld
it had very nice UI
tawfekov
+1  A: 

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 =)

Fabrizio Calderan
Also, IE9 will have an option to format minified JavaScript. It's available in Platform Preview 6: http://blogs.msdn.com/b/ie/archive/2010/10/28/html5-using-the-whole-pc-sixth-ie9-platform-preview-available-for-developers.aspx
rlovtang
+1  A: 

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. Pretty Print Preview

Nick Craver
A: 

See our SD Formatter for ECMAScript.

Ira Baxter
+1  A: 

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).

idealmachine