koa-html-minifier
DefinitelyTyped icon, indicating that this package has TypeScript declarations provided by the separate @types/koa-html-minifier package

3.0.0 • Public • Published

Koa HTML Minifier

Middleware that minifies your HTML responses using html-minifier-terser. 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 Build status Test coverage License

Install

# npm ..
npm i koa-html-minifier
# yarn ..
yarn add koa-html-minifier

API

// 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

Package Sidebar

Install

npm i koa-html-minifier

Weekly Downloads

29

Version

3.0.0

License

MIT

Unpacked Size

5.67 kB

Total Files

4

Last publish

Collaborators

  • coderhaoxin
  • jongleberry
  • 3imed-jaberi