Recommend 5 excellent JavaScript code compression tools. Code compression (also known as Code minimization) is the process of eliminating all unnecessary characters from the source code, including removing all unnecessary empty characters, new line characters, comments, and so on. Code compression does not affect the functionality of the source code, but increases the load time (and the performance of the Web application) because the size of the file being downloaded is reduced.
Here are 5 good JavaScript code compression tools, and I'm sure they'll make your scripts lighter and more code-capable.
First, YUI compressor
Yahoo produced! YUI Compressor is a Java written, help you minimize JavaScript file command-line tools. is safe and has a higher compression ratio than other tools. Not only that, YUI compressor can also compress CSS files.
Second, Google Closure Compiler
Google Closure Compiler is a tool that allows JavaScript to download and run faster. This is a pretty good JavaScript compiler. Using machine language instead of the source language allows you to compile better JavaScript in JavaScript. You can use it to parse JavaScript, analyze, delete unwanted code, rewrite and compress remaining code, and so on. It also examines syntax, variable references, and types, and prompts you for common JavaScript errors.
Third, Jsmin
Jsmin can remove comments and unnecessary spaces from JavaScript files, which can generally reduce the size of the file by half and make the download faster. It also encourages more expressive programming styles.
Four, Packer
Packer is also a popular JavaScript compression tool that can automatically create compressed version of the code. You just have to paste and click the "Pack" button. It enables high compression and increases advanced dynamic compression when running with JavaScript.
V. Dojo Shrinksafe
Shrinksafe is also a more common JavaScript code compression tool. Depending on your programming style, it can reduce the size of the script by One-third or more. Most importantly, Shrinksafe will never change the public variable or API, that is, you can put the compressed version of JavaScript into your page without changing the code that uses it.
Reward Tools
Detect which compression tool is more appropriate for you, eliminating the hassle of installing various tools for testing.
Because of the different applications, in many cases, it can be difficult to find the right JavaScript code compression tool, and now we recommend a tool to detect which tool is right for you without having to install all the compression tools.
Try this: the JavaScript compressorrater
Note: This tool is mainly aimed at jsmin, Dojo Shrinksafe, YUI compressor and Packer