# koa-html-minifier

> minify HTML responses like some crazy guy

Latest version **3.0.0** (published 2021-09-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install koa-html-minifier
pnpm add koa-html-minifier
yarn add koa-html-minifier
bun add koa-html-minifier
```

## Health

**Score 23/100 (F)** — status: abandoned.

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.0.0 |
| Published | 2021-09-25 |
| First published | 2014-06-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/koa-html-minifier) |
| Module format | CommonJS |
| Node | >= 12 |
| Dependencies | 1 |
| Unpacked size | 5.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 32 |
| Author | Jonathan Ong |
| Maintainers | aheckmann, coderhaoxin, jongleberry, 3imed-jaberi |
| Keywords | koa, html, css, htmlmin, min, compress, minification, minifier, minify, uglifier, uglify, terser |

## Links

- npm: https://www.npmjs.com/package/koa-html-minifier
- Repository: https://github.com/koajs/html-minifier
- Issues: https://github.com/koajs/html-minifier/issues
- npm.io page: https://npm.io/package/koa-html-minifier

## Dependencies (1)

- [html-minifier-terser](https://npm.io/package/html-minifier-terser.md) ^6.0.2

## Alternatives

- [@tsparticles/shape-image](https://npm.io/package/@tsparticles/shape-image.md) — 303.7K weekly downloads
- [@tsparticles/shape-line](https://npm.io/package/@tsparticles/shape-line.md) — 233.7K weekly downloads
- [stringify-attributes](https://npm.io/package/stringify-attributes.md) — 58.6K weekly downloads
- [mobile-drag-drop](https://npm.io/package/mobile-drag-drop.md) — 46.3K weekly downloads
- [@comunica/actor-rdf-parse-html](https://npm.io/package/@comunica/actor-rdf-parse-html.md) — 29.2K weekly downloads

## Recent versions

- 3.0.0 (latest) — 2021-09-25
- 2.1.0 — 2021-04-25
- 2.0.0 — 2020-07-08
- 1.0.1 — 2014-09-16
- 1.0.0 — 2014-06-13

## README

# Koa HTML Minifier

Middleware that minifies your HTML responses using [html-minifier-terser][html-minifier-terser-repo].
It uses `html-minifier-terser`'s default options which are all turned off by default,
so you __have__ to set the options otherwise it's not going to do anything.

[![NPM version][npm-img]][npm-url]
[![Build status][travis-img]][travis-url]
[![Test coverage][coveralls-img]][coveralls-url]
[![License][license-img]][license-url]

## Install

```bash
# npm ..
npm i koa-html-minifier
# yarn ..
yarn add koa-html-minifier
```

## API

```js
// do compression stuff first
app.use(require('koa-compress')());

// then use this minifier
app.use(require('koa-html-minifier')({
  collapseWhitespace: true
}));
```

### Options

See: https://github.com/DanielRuf/html-minifier-terser#options-quick-reference

## Contributors

| Name              | Website                           |
| ----------------- | --------------------------------- |
| **Jonathan Ong**  | <http://jongleberry.com>          |
| **Imed Jaberi**   | <https://www.3imed-jaberi.com/>   |
| **João Carmona**  |                                   |


[npm-img]: https://img.shields.io/npm/v/koa-html-minifier.svg?style=flat-square
[npm-url]: https://npmjs.org/package/koa-html-minifier

[travis-img]: https://img.shields.io/travis/koajs/html-minifier.svg?style=flat-square
[travis-url]: https://travis-ci.org/koajs/html-minifier

[coveralls-img]: https://img.shields.io/coveralls/koajs/html-minifier.svg?style=flat-square
[coveralls-url]: https://coveralls.io/r/koajs/html-minifier?branch=master

[license-img]: https://img.shields.io/badge/license-MIT-green.svg?style=flat-square
[license-url]: LICENSE

[html-minifier-terser-repo]: https://github.com/DanielRuf/html-minifier-terser

---
_Source: https://npm.io/package/koa-html-minifier · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
