You can use this : jsbeautifier.org But it depends on the minify method you are using, this one only formats the code, it doesn't change variable names, nor uncompress base62 encoding.
Up vote 115 down vote favorite 65 share g+ share fb share tw.
I'm specifically looking to unminify a minified JavaScript file, so variable renaming (like with compression or packing) should theoretically not be an issue. Javascript code-formatting minify decompression unminify link|improve this question edited Jun 22 '09 at 16:33altCognito16k13367 asked May 4 '09 at 21:20Andy Ford2,9342822 100% accept rate.
You can use this : jsbeautifier.org/ But it depends on the minify method you are using, this one only formats the code, it doesn't change variable names, nor uncompress base62 encoding. Edit: in fact it can unpack "packed" scripts (packed with Dean Edward's packer : http://dean.edwards. Name/packer/).
2 +1 - I've used this method before, and jsbeautifier.org is an excellent service. – Daniel Lew May 4 '09 at 21:27 Thanks. This is exactly what I was looking for.
– Andy Ford May 4 '09 at 21:29 1 Nope, I said base 62 : dean.edwards. Name/packer and en.wikipedia.org/wiki/Base_62 – Fabien Ménager May 5 '09 at 6:25 1 is there such a thing as a tool that "changes variable names" and is still aware of JS syntax to not break the code? – Jorge Vargas Sep 7 '09 at 7:57 3 would up this 10 times if I could.
Just saved me from a wasted day! – benlumley Sep 15 '09 at 16:34.
Chrome developer tools has this feature built-in. Bring up the developer tools (pressing F12 is one way), in the Scripts tab, the bottom left bar has a set of icons. The "{}" icon is "Pretty print" and does this conversion on demand.
UPDATE: IE9 "F12 developer tools" also has a "Format JavaScript" feature in the Script tab under the Tools icon there. (see Tip #4 in F12 The best kept web debugging secret).
For the particular . Js I was trying to un-minify, this method worked the best, cheers. – igneosaur Oct 6 '11 at 17:33.
1 for answer that also works. Fabien just happened to reply first – Andy Ford May 4 '09 at 21:30 This only answer the "decompress" part of the question. – Jorge Vargas Sep 7 '09 at 7:58.
Most of the IDEs also offer auto-formatting features. For example in NetBeans, just press CTRL+K.
In Firefox, SpiderMonkey and Rhino you can wrap any code into an anonymous function and call its toSource method, which will give you a nicely formatted source of the function. ToSource also strips comments. E.
G. : (function () { /* Say hello. */ var x = 'Hello!
'; print(x); }).toSource() Will be converted to a string: function () { var x = "Hello! "; print(x); } P. S.
: It's not an "online tool", but all questions about general beautifying techniques are closed as duplicates of this one.
Interesting. I asked the question 2.5 years ago so I feel it's too late to edit the title, but I still like seeing both online and offline options. Thanks for chiming in.
+1 – Andy Ford Oct 3 '11 at 19:55.
As an alternative (since I didn't know about jsbeautifier.org until now), I have used a bookmarklet that reenabled the decode button in Dean Edward's Packer. I found the instructions and bookmarklet here. Here is the bookmarklet (in case the site is down) javascript:for%20(i=0;i Length;++i)%20{for(j=0;j RemoveAttribute(%22disabled%22);}}.
Try this one, with code coloration: labs.swelen.com/tools/javascript/beauty.....
I'm not sure if you need source code. There is a free online JavaScript formatter at blackbeltcoder.com/Resources/JSFormatter....
If you have a Mac and TextMate - An easy alternative for formatting Javascript is: Open the file with Textmate. Click on > Bundles > JavaScript > Reformat Document Crack open a beer.
Beer being served right now :) – dgilperez Dec 9 '11 at 16:48.
Click on these link for JS deminification. That will install on FF as extension that help you in debugging js at runtime. Https://addons.mozilla.org/en-US/firefox/addon/javascript-deminifier/eula/141018?src=dp-btn-primary.
If one is in JS possibility of using Firefox is more. And if its Firefox add on is for rescue. Following one is particularly useful.
Https://addons.mozilla.org/en-US/firefox/addon/phoenix.
I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.