Crates.io | minify |
lib.rs | minify |
version | 1.3.0 |
source | src |
created_at | 2018-07-01 06:50:25.635277 |
updated_at | 2021-12-04 13:21:00.002155 |
description | Crate for text minification. Currently supported: html, json |
homepage | https://github.com/mettke/minify-rs |
repository | https://github.com/mettke/minify-rs |
max_upload_size | |
id | 72388 |
size | 29,437 |
Minification tool for html and json
First add the library to the dependencies of your project like this:
[dependencies]
minify = "1.2"
Afterwards you can import the library like this:
extern crate minify;
The following rules are applied for html minification:
_<_html_>_
=> <html>
extern crate minify;
use minify::html::minify;
fn main() {
let html = r#"
<html>
<head>
</head>
<body>
</body>
<html>
"#;
let html_minified = minify(html);
}
The following rules are applied for json minification:
extern crate minify;
use minify::json::minify;
fn main() {
let json = r#"
{
"test": "test",
"test2": 2
}
"#;
let json_minified = minify(json);
}
License: MIT