Express HTML Minification Middleware
JSON →express-minify-html is an Express middleware designed to automatically minify HTML responses generated by `res.render` calls. It leverages the robust `html-minifier` library under the hood, passing configuration options directly to it. The current stable version is 0.12.0. While there's no stated release cadence, its versioning suggests a pre-1.0 status, implying potential API changes in minor versions. A key differentiator is its seamless integration with Express's existing `res.render` function, with an option to `override` it directly or expose a new `res.renderMin` method. It also supports `exception_url` configurations, allowing developers to selectively bypass minification for specific routes using strings, regular expressions, or custom functions. This helps optimize performance by reducing HTML payload size for most requests without affecting critical or dynamic paths that might be sensitive to minification.
Traffic · last 30 days ↓40% vs prev 7d
top countries 🇺🇸 United States · 🇨🇦 Canada · 🇩🇪 Germany · 🇫🇷 France