Videos
How to unminify a JavaScript file in VS Code?
Install a prettifier extension from the market. They’re sometimes called beautifiers, too.
More on reddit.comUnminify HTML in terminal
code formatting - Tool to Unminify / Decompress JavaScript - Stack Overflow
HTML minify and un-minify - HTML & CSS - SitePoint Forums | Web Development & Design Community
Does anyone know how to unminify JavaScript code in VS Code? Currently my JS code looks like. I've found several different suggestions online, but none have worked:
-
ctrl-k, followed by ctrl-d
-
ctrl-e, followed by d
-
alt+shift+f
-
right click on code and select 'format'
I realize I might not be able to recover all data, but I'm looking to at least format the code in a more readable manner.
Thanks in advance.
Install a prettifier extension from the market. They’re sometimes called beautifiers, too.
Shift + Alt + F should have gotten you close. Does it only partially format it?
Another solution worth trying might be using the Prettifier extension. That might make the auto formatting better.
After you format it the first time you can manually format parts on your own and rerun the formatter to see if it gets any closer. Using regular expressions for find replace can also do a lot of work for you.
I got a minified website. So when I curl it and I get a HTML file but the whole code is in one line. If I use firefox and save that page then I get the arranged source code of it. As I am making a Script I can't use firefox so is there any way to curl a website and unminify it within terminal
You can use this : http://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/)
Chrome developer tools has this feature built-in. Bring up the developer tools (pressing F12 is one way), in the Sources 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)
