https://github.com/jkamsker/nminify
Wrapper for minify, which minifies web formats
https://github.com/jkamsker/nminify
csharp css dotnet go golang html javascript js json minifier minify net-7 nminify svg xml
Last synced: about 1 year ago
JSON representation
Wrapper for minify, which minifies web formats
- Host: GitHub
- URL: https://github.com/jkamsker/nminify
- Owner: JKamsker
- License: mit
- Created: 2023-01-16T22:27:05.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2024-05-03T17:13:09.000Z (about 2 years ago)
- Last Synced: 2025-04-11T16:24:20.104Z (about 1 year ago)
- Topics: csharp, css, dotnet, go, golang, html, javascript, js, json, minifier, minify, net-7, nminify, svg, xml
- Language: C#
- Homepage:
- Size: 34.2 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
- License: License.md
Awesome Lists containing this project
README
[](https://www.nuget.org/packages/NMinify)
[](https://www.nuget.org/packages/NMinify)
[](https://github.com/JKamsker/NMinify/actions)
[](https://github.com/JKamsker/NMinify/blob/master/LICENSE.txt)
[](https://github.com/JKamsker/NMinify/pulls)
## Introduction
NMinify is a Wrapper for the [golang library minify](https://github.com/tdewolff/minify).
Minification is the process of removing bytes from a file (such as whitespace) without changing its output and therefore shrinking its size and speeding up transmission over the internet and possibly parsing. The implemented minifiers are designed for high performance.
## Installation
To install NMinify, run the following command in the Package Manager Console:
```
Install-Package NMinify
```
You can also install NMinify via the .NET CLI by running:
```
dotnet add package NMinify
```
Alternatively, you can add NMinify as a dependency in your project's `.csproj` file:
```xaml
```
Make sure to replace `x.x.x` with the latest version available on [NuGet](https://www.nuget.org/packages/NMinify/).
Once NMinify is installed, you can start using it in your project by adding `using NMinify;` to the top of your file.
## Basic Usage
```csharp
var text = "Some text";
var minifier = new Minifier();
var minified = minifier.MinifyString(MinifierMediaType.Html, text);
Console.WriteLine(text); // Output: Some text
Console.WriteLine(minified); // Output: Some text
```
## Available Methods
```csharp
Span MinifyBytes(MinifierMediaType mediaType, ReadOnlySpan input, Span output);
string MinifyFile(string mediatype, string input);
string MinifyString(MinifierMediaType mediaType, string input);
```
# License
NMinify is released under the [MIT License](https://opensource.org/licenses/MIT). This means that you are free to use, modify, and distribute this software as long as you include the original copyright and license notice in your distribution.
Please note that the underlying minify library by tdewolff is also released under the MIT License, and its copyright and license must also be included in any distribution of NMinify.
By using NMinify, you are agreeing to the terms of the MIT License. If you do not agree to these terms, you should not use this software.
----------
Made with stackedit.io, minify and lots of ❤️ in Austria