Express HTML Minification Middleware

JSON →
library 2.0.0 ·javascript
verified May 27, 2026

express-minify-html-2 is an Express.js middleware designed to automatically minify HTML responses rendered by an Express application, optimizing them for size. It functions as a maintained fork of the original `express-minify-html` package, explicitly created to keep the project alive and address issues like using outdated dependencies, most notably by integrating `html-minifier-terser` for robust and secure HTML minification. The current stable version is `2.0.0`. While it doesn't adhere to a strict release cadence, updates are released reactively for dependency upgrades, security fixes, and minor feature enhancements. The middleware either replaces Express's default `res.render` method with a minified version or provides an alternative `res.renderMin` function when the `override` option is set to `false`. This ensures that HTML served to clients is optimized for load times and bandwidth efficiency through configurable minification options passed directly to the underlying `html-minifier-terser` library.

total hits 13
actors 6 distinct systems
last hit 3d ago human
MetaBot
4
GPTBot
2
Script
1
Search engines
2
Humans
1

top countries 🇺🇸 United States · 🇨🇦 Canada · 🇧🇷 Brazil · 🇩🇪 Germany