/koa-html-minifier2

minify HTML responses like some crazy guy

Primary LanguageJavaScriptMIT LicenseMIT

Koa HTML Minifier 2

License MIT Build Status Coverage Status NPM Version NPM Download

It is the like as koajs/html-minifier, and supports koa 2.x.

Middleware that minifies your HTML responses using html-minifier. It uses html-minifier'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.

Install

npm i --save koa-html-minifier2

Usage

const htmlMinifier2 = require('koa-html-minifier2')

app.use(htmlMinifier2({
  collapseWhitespace: true,
  minifyCSS: true,
  minifyJS: true
}))

Options

See: https://github.com/kangax/html-minifier#options-quick-reference