Express middleware that wraps html-minifier-terser to minify HTML responses. Version 1.0.2, no recent updates, stable. Replaces deprecated express-minify-html with up-to-date html-minifier-terser. Intercepts res.render() or adds res.renderMin() for minification. Supports configuration of html-minifier options and exception URLs.
npm install express-minify-html-terserNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows basic setup with minification options and exception URL disabled.
Set exception_url to an array of regex/strings/functions to skip minification for certain routes.
Switch to express-minify-html-terser for support.
Test thoroughly; refer to html-minifier-terser documentation for valid options.
Use const minifyHTML = require('express-minify-html-terser'); (without .default)Run: npm install html-minifier-terser
Pass an object with at least an htmlMinifier property: minifyHTML({ htmlMinifier: { removeComments: true } })