UglifyJS
UglifyJS is a code compression tool built on the nodeJS server. Currently, jQuery uses this tool to compress and the compression effect is better.
GitHub home: http://github.com/mishoo/UglifyJS/
Online use: http://marijnhaverbeke.nl/uglifyjs
Usage:
- Download nodejs from the http://nodejs.org and use node.exe
- Download the latest version from the GitHub homepage of UglifyJS.
- Copy node.exe to the bin directory of UglifyJS.
- Modify bin \ uglifyjs and change require ("uglify-js") to require ("../uglify-js"). If you are prompted that uglify-js cannot be found
- RunNode uglifyjs-oFancyValidate. min. js fancyValidate. js
Note that you must first specify the-o parameter, followed by the compressed file name, and finally the source file.
If the download is troublesome, use its online version directly.
Microsoft Ajax Minifier
Microsoft Ajax Minifier is a Microsoft code compression tool that supports JavaScript and css code compression.
Official homepage: http://ajaxmin.codeplex.com/
Download and install fancyValidate. js-o fancyValidate. min. js.
For more parameter usage, see the official documentation: http://ajaxmin.codeplex.com/wikipage? Title = Command-Line % 20 Switches
Google Closure Compiler
The Code compression tool produced by Google requires support from JRE (download from http://www.java.com/zh_cn/download /)
Official homepage: http://code.google.com/p/closure-compiler/
Install JRE first, which is easy to use:Java-jar compiler. jar -- JsHello. js-- Js_output_fileHello-compiled.js
For more parameter descriptions, see the relevant documentation: https://developers.google.com/closure/compiler/docs/overview
YUI Compressor
Yahoo! The Code compression tool developed by the UI team supports JavaScript and css code compression, and JRE is also required.
Official homepage: http://developer.yahoo.com/yui/compressor/
GitHub home: https://github.com/yui/yuicompressor
Download the following code from http://yuilibrary.com/download/yuicompressor:Java-jar yuicompressor-2.4.7.jarMyfile. js-OMyfile-min.js
For more parameter descriptions, see the official homepage or https://github.com/yui/yuicompressor/blob/master/doc/README
Packer
The famous js Daniel Dean Edwards writes a high compression ratio.
Official homepage: http://dean.edwards.name/packer/
It takes a long time, but it is still easy to use and many parameter settings are provided.
JSMIN
In the age similar to Packer, only comments and blank spaces are compressed.
Official homepage: http://www.crockford.com/javascript/jsmin
Provides a doscommand line version: http://www.crockford.com/javascript/jsmin.zip
Easy to use:Jsmin <FancyValidate. js>FancyValidate. min. js
End
Here, it is easy to use JSLint (http://www.jslint.com/) to check the code before compression, otherwise it is likely to cause compression failure.
Author: jinyue