Express middleware for minifying HTML rendered by Handlebars templates. Version 0.1.4, no active release cadence (last update unknown). Wraps html-minifier and overrides res.render to produce minified output. Use with caution: may break spacing of CSS-dependent layouts. Adds optional res.renderMin method if override is false. Supports exception URLs via strings, regexes, or functions. Risk of footguns due to aggressive minification defaults.
npm install express-hbsminNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Basic setup with Express and Handlebars to minify HTML output via overridden res.render.
Use exception_url to exclude pages where spacing matters, or customize htmlMinifier options.
Set override: false and use res.renderMin instead.
Use require() in Node.js. No ESM support planned.
Provide an array of URLs/regexes/functions to skip minification when needed.
Use const minifyHbs = require('express-hbsmin');Set collapseWhitespace: false or use exception_url to skip minification on affected pages.
npm install html-minifier express-hbsmin