SkillAgentSearch skills...

JSMin.NET

A .NET port of the Douglas Crockford's JSMin.

Install / Use

/learn @Taritsyn/JSMin.NET
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

JSMin for .NET NuGet version Download count

JSMin.NET is a .NET port of the Douglas Crockford's JSMin.

Installation

This library can be installed through NuGet - http://nuget.org/packages/DouglasCrockford.JsMin.

Usage

Consider a simple example of usage of the JSMin.NET:

using System;

using DouglasCrockford.JsMin;

namespace TestJsMinDotNet
{
    class Program
    {
        static void Main(string[] args)
        {
            const string code = @"function square(num) {
    return num * num;
}";
            var minifier = new JsMinifier();

            try
            {
                string result = minifier.Minify(code);

                Console.WriteLine("Result of JavaScript minification:");
                Console.WriteLine();
                Console.WriteLine(result);
            }
            catch (JsMinificationException e)
            {
                Console.WriteLine("During minification of JavaScript code an error occurred:");
                Console.WriteLine();
                Console.WriteLine(e.Message);
            }

            Console.ReadLine();
        }
    }
}

First we create an instance of the <code title="DouglasCrockford.JsMin.JsMinifier">JsMinifier</code> class. Then we minify a JavaScript code by using of the Minify method and output its result to the console. In addition, we provide handling of the <code title="DouglasCrockford.JsMin.JsMinificationException">JsMinificationException</code> exception.

License

Douglas Crockford's License

Who's Using JSMin for .NET

If you use the JSMin for .NET in some project, please send me a message so I can include it in this list:

View on GitHub
GitHub Stars23
CategoryDevelopment
Updated1mo ago
Forks5

Languages

C#

Security Score

80/100

Audited on Feb 27, 2026

No findings