Replacements for html-minifier
html-minifier-next
html-minifier-next is the official successor to html-minifier. It is actively maintained, faster, and adds features such as SVG minification and preset configurations.
ts
import minify from 'html-minifier'
import { minify } from 'html-minifier-next'
const html = '<p title="example">foo</p>'
const result = minify(html, { collapseWhitespace: true })
const result = await minify(html, { collapseWhitespace: true })