Data, Maps, Usability, and Performance

Unminify HTML, CSS, and JS Code with JavaScript

Last updated on October 27, 2014 in Development

Beautify and Unminify Code

Online Tool to Unminify HTML, CSS, and JS

There are a few reasons to minify code, the major one being web performance. Browsers don’t need whitespace and comments to process your files. But, it’s not fun to work obfuscated code and I find myself often using jsbeautifier to uncompress source code. Today, I decided to implement this tool myself show how you can unminify and reformat HTML, CSS, and JS code with a JavaScript function. Since js-beautify is open source and supports JavaScript, this was an easy task.

Instead of loading all the CSS, HTML, and JavaScript rules on page load, the beautify JavaScript function retrieves the necessary code on request via RequireJS. It then looks through the html source and makes the code readable. There are specifc options you can set for indentation and code formatting. If you need to unminify your code, here is another Online Tool to Beautify Code.

Tags:

Facebook Twitter Hacker News Reddit More...