5 JavaScript code compression tools recommended

  • 2020-03-30 03:29:54
  • OfStack

Recommend 5 excellent JavaScript code compression tools. Code compression (also known as code minimization) is the process of removing all unnecessary characters from the source code, including removing all unnecessary space characters, newline characters, comments, and so on. Code compression does not affect the functionality of the source code, but increases load time (and the performance of the web application) because the size of the file to be downloaded is reduced.

Here are 5 great JavaScript code compression tools that I'm sure will make your scripts lighter and better.

A, (link: http://yui.github.io/yuicompressor/)

Produced by the Yahoo! YUI Compressor is a command line tool written in Java to help you minimize JavaScript files. It is safe and has a higher compression ratio than other tools. Not only that, YUI Compressor can also compress CSS files.

Second, (link: https://developers.google.com/closure/compiler/)

Google Closure Compiler is a tool that lets JavaScript download and run faster. This is a pretty good JavaScript compiler. Using machine language instead of source language lets you compile better JavaScript in JavaScript. You can use it to parse JavaScript, analyze, remove dead code, rewrite and compress the rest of the code, and more. It also checks for syntax, variable references, and types, and makes hints for common JavaScript errors.

Three, (link: https://developers.google.com/closure/compiler/)

JSMin can remove comments and unnecessary Spaces from JavaScript files, and it can often reduce the size by half, making downloads faster. It also encourages a more expressive programming style.

Four, (link: https://developers.google.com/closure/compiler/)

Packer is also a popular JavaScript compression tool that automatically creates compressed versions of the code. You just paste and click the "Pack" button. It can achieve high compression, with JavaScript runtime to add advanced dynamic compression.

Fifth, (link: https://developers.google.com/closure/compiler/)

ShrinkSafe is also a common JavaScript code compression tool. Depending on your programming style, it can reduce the size of the script by a third or more. Most importantly, ShrinkSafe never changes public variables or apis, which means you can put a compressed version of JavaScript on your page without changing the code that USES it.

Reward tool

Detect which compression tool is best for you, eliminating the hassle of installing various tools for testing.

Depending on your application, in many cases it can be difficult to find the right JavaScript code compression tool for you, but it is recommended that you have a tool that can detect which one is right for you without having to install all the compression tools.

Try: (link: http://compressorrater.thruhere.net/)

Note: this tool is targeted at JSMin, Dojo ShrinkSafe, YUI Compressor, and Packer


Related articles: