An efficient JavaScript compression tool download set

Source: Internet
Author: User

Comparison with other compression tools:
1. JavaScript Compressor (http://dean.edwards.name/packer)
Take his own compression tool code as an example (v2.02). The packer size is 7,428 bytes after compression (comment removal ).
Our compression tool can be compressed to 7,256 bytes.
7256/7428 = 0.9768443726440496
2. Dojo ShrinkSafe)
Take the source code of the framework as an example (v0.4.1 ):
The compression size is 149,518 bytes, which can be reduced to 81,261 bytes after compression.
81261/149518 = 0.5434864029748927

Security description:
1. JavaScript Compressor TBCompressor (YUI Compressor) recommended
Text-based compression, I did not elaborate on the logic, but the possibility of such compression problems is very low, our compression tool also uses his compression algorithm, in JSI 1.1 a8 and
In the test of the third-party class library integrated by Alibaba Cloud, no exception was found. There are also well-known frameworks for JQuery, and I believe there will be no problem.

2. Dojo ShrinkSafe dangerous !!!!!
Replace the long local variable name with a short name. This is an extremely insecure compression tool. For example:

Java code


Function (){
Var withObject = {variable1: 1}
Var variable1 = 2;
With (withObject ){
Alert (variable1 );
}
}

Compress
Java code


Function (){
Var _ 1 = {variable1: 1 };
Var _ 2 = 2;
With (_ 1 ){
Alert (_ 2 );
}
}

This is obviously incorrect. This spam does not pay attention to some special javascript syntaxes and is dynamic.
No processing is performed on eval functions, catch operations, and with statements.
In contrast, JSA is the most secure and effective compression tool I know.
JSA not only supports code compression, but also supports formatting and script analysis.

The script analysis function can be used to view the script information and find potential problems in the script.
For example, you can view the functions and variables in the script.
The external variables are used. And so on...
The JSA compression process is divided into two steps. The first step is syntax compression, which is similar to Dojo ShrinkSafe, but is safer and more effective than him.

Step 2: Text compression. Currently
JavaScript Compressor compression algorithm.
Http://dean.edwards.name/packer)

You can set these settings in the settings window.

By default, the file is first compressed with syntax. When the file is larger than 90% kb and the text can still be compressed to the original size of, the original text is compressed.

:
Http://sourceforge.net/project/showfiles.php? Group_id = 175776
Or
Http://forum.xidea.org file list

Related Article

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.