Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/koajs/html-minifier
minify HTML responses like some crazy guy
https://github.com/koajs/html-minifier
Last synced: 2 months ago
JSON representation
minify HTML responses like some crazy guy
- Host: GitHub
- URL: https://github.com/koajs/html-minifier
- Owner: koajs
- License: mit
- Created: 2014-06-13T08:01:34.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2023-04-28T16:57:07.000Z (over 1 year ago)
- Last Synced: 2024-04-14T13:08:40.162Z (8 months ago)
- Language: JavaScript
- Size: 718 KB
- Stars: 30
- Watchers: 6
- Forks: 5
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-koa - html-minifier - minify HTML responses like some crazy guy (Middleware)
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** | |
| **Imed Jaberi** | |
| **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