Tool to Unminify / Decompress JavaScript
You cannot truly unminify javascript, as minified javascript replaces variable names with letters, as well as removing code comments - these cannot be "undone" as the original information no longer exists.
It appears that you can at least recreate appropriate spacing, but "real" minified javascript cannot be undone.
Answer from Kritner on Stack OverflowDoes 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.
Tool to Unminify / Decompress JavaScript
You cannot truly unminify javascript, as minified javascript replaces variable names with letters, as well as removing code comments - these cannot be "undone" as the original information no longer exists.
It appears that you can at least recreate appropriate spacing, but "real" minified javascript cannot be undone.
You can use Prettier https://prettier.io/docs/en/install.html, to get the script slightly human readable.
If you are having problem with vs code you can add this in your settings.json
"[javascript]": { "editor.defaultFormatter": "esbenp.prettier-vscode" },
It works for me for mega file...
Videos
Try https://unminify.com/. Nothing to install, nothing to pay. Copy, paste, boom:
.style1,
.style2,
.style3 {
float: right
}
.style1 {
border-radius: 15px
}
.style2 {
border-radius: 0
}
.style3 {
border-radius: 10px
}
If you have Atom text editor, you can use atom-beautify . The link to the package is https://atom.io/packages/atom-beautify . That formats the code into well organized structure.
From your minified css, it formats it to look like this
.style1 {
float: right;
border-radius: 15px;
}
.style2 {
float: right;
border-radius: 0;
}
.style1 {
float: right;
border-radius: 10px;
}
With that atom package, you can format other popular languages, such as JavaScript, Python, Ruby, Swift, etc.
I hope this is what you are looking for.