your-html-minifier is a Koa middleware for minifying HTML responses using the popular html-minifier library. Version 0.2.0 provides a simple integration for Koa 2.x, allowing developers to easily enable HTML minification with options like collapseWhitespace, minifyCSS, and minifyJS. Compared to the original koajs/html-minifier, this package offers similar functionality but is maintained under the yourjs organization. The release cadence is not well documented, but it is a lightweight wrapper around the well-established html-minifier package.
npm install your-html-minifierNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates how to use the htmlMinifier middleware in a Koa 2.x application with common minification options.
Refer to https://github.com/kangax/html-minifier#options-quick-reference for all available options.
Ensure your project uses Koa 2.x. For Koa 1.x, consider using koajs/html-minifier instead.
Consider using html-minifier-terser or other actively maintained alternatives.
Use 'import htmlMinifier from "your-html-minifier"' instead of 'import { htmlMinifier } from "your-html-minifier"'.Use 'import htmlMinifier from "your-html-minifier"' and apply as middleware.
Run 'npm install html-minifier' in your project.