5 JavaScript code compression tool recommended _javascript Tips

Source: Internet
Author: User
Tags closure

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.