## Usage
### CLI
Precompiled binaries are available for x86-64 Linux, macOS, and Windows.
##### Get
[Linux](https://wilsonl.in/minify-html/bin/0.3.10-linux-x86_64) |
[macOS](https://wilsonl.in/minify-html/bin/0.3.10-macos-x86_64) |
[Windows](https://wilsonl.in/minify-html/bin/0.3.10-windows-x86_64.exe)
##### Use
Use the `--help` argument for more details.
```bash
minify-html --src /path/to/src.html --out /path/to/output.min.html
```
### API
Hello, world!
", cfg); // Alternatively, minify in place to avoid copying. const source = Buffer.from("Hello, world!
"); // This is a Buffer representing a slice of `source`, not newly allocated memory. const minified = minifyHtml.minifyInPlace(source, cfg); ``` minify-html is also available for TypeScript: ```ts import * as minifyHtml from "@minify-html/js"; import * as fs from "fs"; const cfg = minifyHtml.createConfiguration({ minifyJs: false }); const minified = minifyHtml.minify("Hello, world!
", cfg); // Or alternatively: const minified = minifyHtml.minifyInPlace(fs.readFileSync("source.html"), cfg); ```Hello, world!
", cfg); } catch (SyntaxException e) { System.err.println(e.getMessage()); } // Alternatively, minify in place: assert source instanceof ByteBuffer && source.isDirect(); MinifyHtml.minifyInPlace(source, cfg); ```Hello, world!
", minify_js=False) except SyntaxError as e: print(e) ```Hello, world!
", { :minify_js => false }) ```| Before | After |
|---|---|
|
```html
↵ ··The·quick·brown·fox↵ ··jumps·over·the·lazy↵ ··dog.↵ ``` |
```html
·The·quick·brown·fox·jumps·over·the·lazy·dog.· ``` |
| Before | After |
|---|---|
```html
|
```html
|
| Before | After |
|---|---|
|
```html
↵ ··Hey,·I·just·found↵ ··out·about·this·cool·website!↵ ··[1]↵ ``` |
```html
Hey,·I·just·found↵ ··out·about·this·cool·website!↵ ··[1] ``` |
↵ ··Hey,·I·just·found↵ ··out·about·this·cool·website!↵ ··[1]↵
``` ###### After ```htmlHey,·I·just·found·out·about·this·cool·website!·[1]
```