Class JavaScriptMinifier

JavaScript minifier strips white space and comments from JavaScript code. Based on Douglas Crockford's JavaScript Minifier with some modification to support string and StreamReader conversions.

This class can minify strings in memory or files and entire directories of disk files.

The MinifyDirectory() method can be used in the build process for VS or can easily be used at application startup to automatically create minified script files for an application.


public class JavaScriptMinifier : object

Class Members

Minify Minifies a source file into a target file.
public void Minify( string sourceFile,
string targetFile );
MinifyDirectory Minifies all JavaScript files in a given directory and writes out the minified files to a new file extensions (.min.js for example).
public static void MinifyDirectory( string path,
string minExtension,
bool recursive );
MinifyString Minifies a JavaScript code string into a minified string.
public string MinifyString( string sourceJavaScriptString );


Namespace: Westwind.Web.Controls
Assembly: westwind.ajaxtoolkit.dll

  Last Updated: 7/15/2008 | © West Wind Technologies, 2008