html-minifier-next 4.8.0 → 4.8.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [![npm version](https://img.shields.io/npm/v/html-minifier-next.svg)](https://www.npmjs.com/package/html-minifier-next) [![Build status](https://github.com/j9t/html-minifier-next/workflows/Tests/badge.svg)](https://github.com/j9t/html-minifier-next/actions) [![Socket](https://badge.socket.dev/npm/package/html-minifier-next)](https://socket.dev/npm/package/html-minifier-next)
4
4
 
5
- HTML Minifier Next (HMN) is a highly **configurable, well-tested, JavaScript-based HTML minifier**.
5
+ HTML Minifier Next (HMN) is a **super-configurable, well-tested, JavaScript-based HTML minifier**.
6
6
 
7
7
  The project was based on [HTML Minifier Terser](https://github.com/terser/html-minifier-terser), which in turn had been based on [Juriy Zaytsev’s HTML Minifier](https://github.com/kangax/html-minifier). HMN offers additional features, but is backwards-compatible with both. The project was set up because as of 2025, both HTML Minifier Terser and HTML Minifier had been unmaintained for a few years. As the project seems maintainable [to me, [Jens](https://meiert.com/)]—even more so with community support—, it’s being [updated, extended, and documented](https://github.com/j9t/html-minifier-next/blob/main/CHANGELOG.md) further in this place.
8
8
 
@@ -227,33 +227,32 @@ const result = await minify(html, {
227
227
  How does HTML Minifier Next compare to other minifiers? (All with the most aggressive settings, though without [hyper-optimization](https://meiert.com/blog/the-ways-of-writing-html/#toc-hyper-optimized). Minimize does not minify CSS or JS.)
228
228
 
229
229
  <!-- Auto-generated benchmarks, don’t edit -->
230
- | Site | Original Size (KB) | [HTML Minifier Next](https://github.com/j9t/html-minifier-next)<br>![npm last update](https://img.shields.io/npm/last-update/html-minifier-next) | [HTML Minifier Terser](https://github.com/terser/html-minifier-terser)<br>![npm last update](https://img.shields.io/npm/last-update/html-minifier-terser) | [htmlnano](https://github.com/posthtml/htmlnano)<br>![npm last update](https://img.shields.io/npm/last-update/htmlnano) | [@swc/html](https://github.com/swc-project/swc)<br>![npm last update](https://img.shields.io/npm/last-update/@swc/html) | [minify-html](https://github.com/wilsonzlin/minify-html)<br>![npm last update](https://img.shields.io/npm/last-update/@minify-html/node) | [minimize](https://github.com/Swaagie/minimize)<br>![npm last update](https://img.shields.io/npm/last-update/minimize) | [html­com­pressor.­com](https://htmlcompressor.com/) |
230
+ | Site | Original Size (KB) | [HTML Minifier Next](https://github.com/j9t/html-minifier-next)<br>[![npm last update](https://img.shields.io/npm/last-update/html-minifier-next)](https://socket.dev/npm/package/html-minifier-next) | [HTML Minifier Terser](https://github.com/terser/html-minifier-terser)<br>[![npm last update](https://img.shields.io/npm/last-update/html-minifier-terser)](https://socket.dev/npm/package/html-minifier-terser) | [htmlnano](https://github.com/posthtml/htmlnano)<br>[![npm last update](https://img.shields.io/npm/last-update/htmlnano)](https://socket.dev/npm/package/htmlnano) | [@swc/html](https://github.com/swc-project/swc)<br>[![npm last update](https://img.shields.io/npm/last-update/@swc/html)](https://socket.dev/npm/package/@swc/html) | [minify-html](https://github.com/wilsonzlin/minify-html)<br>[![npm last update](https://img.shields.io/npm/last-update/@minify-html/node)](https://socket.dev/npm/package/@minify-html/node) | [minimize](https://github.com/Swaagie/minimize)<br>[![npm last update](https://img.shields.io/npm/last-update/minimize)](https://socket.dev/npm/package/minimize) | [html­com­pressor.­com](https://htmlcompressor.com/) |
231
231
  | --- | --- | --- | --- | --- | --- | --- | --- | --- |
232
232
  | [A List Apart](https://alistapart.com/) | 59 | **49** | 50 | 51 | 52 | 51 | 54 | 52 |
233
- | [Apple](https://www.apple.com/) | 181 | **140** | **140** | 159 | 162 | 163 | 167 | 165 |
234
- | [BBC](https://www.bbc.co.uk/) | 728 | **662** | 672 | 684 | 684 | 685 | 721 | n/a |
235
- | [CSS-Tricks](https://css-tricks.com/) | 161 | 121 | **119** | 127 | 142 | 142 | 147 | 144 |
236
- | [ECMAScript](https://tc39.es/ecma262/) | 7237 | **6341** | **6341** | 6561 | 6444 | 6567 | 6614 | n/a |
237
- | [EFF](https://www.eff.org/) | 55 | **47** | **47** | 49 | 48 | 49 | 50 | 50 |
238
- | [FAZ](https://www.faz.net/aktuell/) | 1487 | 1386 | 1391 | **1338** | 1416 | 1426 | 1437 | n/a |
239
- | [Frontend Dogma](https://frontenddogma.com/) | 221 | **212** | **212** | 233 | 218 | 220 | 238 | 219 |
240
- | [Google](https://www.google.com/) | 18 | **17** | **17** | **17** | **17** | **17** | 18 | 18 |
241
- | [Ground News](https://ground.news/) | 2345 | **2060** | 2063 | 2155 | 2176 | 2181 | 2332 | n/a |
233
+ | [Apple](https://www.apple.com/) | 258 | **202** | **202** | 230 | 233 | 234 | 236 | 237 |
234
+ | [BBC](https://www.bbc.co.uk/) | 633 | **575** | 585 | 594 | 594 | 595 | 628 | n/a |
235
+ | [CSS-Tricks](https://css-tricks.com/) | 161 | 121 | **119** | 126 | 141 | 141 | 147 | 143 |
236
+ | [ECMAScript](https://tc39.es/ecma262/) | 7238 | **6341** | **6341** | 6561 | 6444 | 6567 | 6614 | n/a |
237
+ | [EFF](https://www.eff.org/) | 55 | **47** | **47** | 50 | 48 | 49 | 50 | 50 |
238
+ | [FAZ](https://www.faz.net/aktuell/) | 1573 | 1465 | 1470 | **1411** | 1498 | 1509 | 1520 | n/a |
239
+ | [Frontend Dogma](https://frontenddogma.com/) | 222 | **213** | **213** | 234 | 219 | 221 | 239 | 220 |
240
+ | [Google](https://www.google.com/) | 76 | **71** | 72 | n/a | 72 | 73 | 76 | 75 |
242
241
  | [HTML Living Standard](https://html.spec.whatwg.org/multipage/) | 149 | **147** | **147** | 153 | **147** | 149 | 155 | 149 |
243
242
  | [Igalia](https://www.igalia.com/) | 49 | **33** | **33** | 35 | 35 | 35 | 36 | 36 |
244
- | [Leanpub](https://leanpub.com/) | 1405 | **1185** | **1185** | 1192 | 1190 | 1187 | 1399 | n/a |
243
+ | [Leanpub](https://leanpub.com/) | 1457 | **1225** | **1225** | 1232 | 1231 | 1226 | 1451 | n/a |
245
244
  | [Mastodon](https://mastodon.social/explore) | 35 | **26** | **26** | 30 | 33 | 33 | 34 | 34 |
246
245
  | [MDN](https://developer.mozilla.org/en-US/) | 107 | **62** | **62** | 64 | 64 | 65 | 67 | 68 |
247
246
  | [Middle East Eye](https://www.middleeasteye.net/) | 222 | **195** | **195** | 202 | 200 | 200 | 202 | 203 |
248
247
  | [Nielsen Norman Group](https://www.nngroup.com/) | 84 | 71 | 71 | **53** | 71 | 72 | 74 | 73 |
249
- | [SitePoint](https://www.sitepoint.com/) | 508 | **366** | **366** | 444 | 482 | 486 | 504 | n/a |
250
- | [TetraLogical](https://tetralogical.com/) | 44 | 38 | 38 | **35** | 38 | 38 | 39 | 39 |
248
+ | [SitePoint](https://www.sitepoint.com/) | 495 | **353** | **353** | 431 | 469 | 473 | 491 | n/a |
249
+ | [TetraLogical](https://tetralogical.com/) | 44 | 38 | 38 | **35** | 37 | 38 | 39 | 39 |
251
250
  | [TPGi](https://www.tpgi.com/) | 99 | **79** | **79** | 84 | 84 | 84 | 88 | 86 |
252
- | [United Nations](https://www.un.org/en/) | 153 | **114** | 116 | 123 | 127 | 126 | 132 | 125 |
253
- | [W3C](https://www.w3.org/) | 50 | **36** | **36** | 38 | 38 | 38 | 40 | 38 |
254
- | **Average processing time** | | 336 ms (22/22) | 374 ms (22/22) | 188 ms (22/22) | 70 ms (22/22) | **17 ms (22/22)** | 366 ms (22/22) | 1351 ms (16/22) |
251
+ | [United Nations](https://www.un.org/en/) | 154 | **115** | 116 | 123 | 127 | 127 | 133 | 126 |
252
+ | [W3C](https://www.w3.org/) | 50 | **36** | **36** | 38 | 38 | 38 | 40 | 39 |
253
+ | **Average processing time** | | 352 ms (21/21) | 401 ms (21/21) | 175 ms (20/21) | 56 ms (21/21) | **17 ms (21/21)** | 395 ms (21/21) | 1481 ms (16/21) |
255
254
 
256
- (Last updated: Dec 7, 2025)
255
+ (Last updated: Dec 10, 2025)
257
256
  <!-- End auto-generated -->
258
257
 
259
258
  ## Examples
@@ -393,7 +392,7 @@ ignoreCustomFragments: [/\{\{[\s\S]{0,500}?\}\}/]
393
392
 
394
393
  **Important:** When using custom `ignoreCustomFragments`, the minifier automatically applies bounded quantifiers to prevent ReDoS attacks, but you can also write safer patterns yourself using explicit bounds.
395
394
 
396
- ## Running HTML Minifier Next
395
+ ## Running HTML Minifier Next locally
397
396
 
398
397
  ### Local server
399
398