Jazmin, the JavaScript Source-Compressor

Jazmin is a console-based utility and an MSBuild task that filters JavaScript by removing comments and unnecessary whitespace. It typically reduces the size of the script by half, resulting in faster downloads. It also encourages a more expressive programming style because it eliminates the download cost of clean, literate self-documentation. Jazmin does not modify the behavior of the original JavaScript source in any way.

Jazmin is a straight C# port of JavaScript Minifier that was originally written by Douglas Crockford in C. Jazmin behaves identically to JSMin so all the documentation on JSMin also applies to Jazmin.

Download

Download Jazmin v1.0 (build 8417) . It includes C# source code as well as binaries compiled in debug and release configurations.

Note: Jazmin's MSBuild task is also available as part of the open source MSBuild Community Tasks Project (see the JSCompress task) as of version 1.2. The version provided in the download here is a stand-alone assembly of the same MSBuild task. The MSBuild Community Tasks Project does not, however, include the command-line version.

Usage

The command-line version of Jazmin reads the source from the standard input and produces the compressed version on the standard output. To compress a single file, pipe through Jazmin like this on Windows Command Prompt:

$ type some.js | jazmin > comp\some.js

To source-compress several files in a single run, consider using FOR like this:

$ for %i in (*.js) do type %i | jazmin > comp\%i

Requirements

License

Jazmin is distributed under the OSI-approved and liberal BSD License:

Copyright (c) 2005, Atif Aziz. All rights reserved. Portion Copyright (c) 2001 Douglas Crockford

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.