Highly configurable, well-tested, JavaScript-based HTML minifier with extensive optimization options
86
A small utility that reorders attributes and class tokens in HTML markup to improve compression benefits while leaving all other content untouched.
@generates
/**
* Reorders HTML attributes and class tokens for compression-friendly layout.
* @param {string} html - Raw HTML markup to process.
* @param {{ sortAttributes?: boolean, sortClasses?: boolean }} [options] - Controls whether attribute and/or class token ordering is applied. Defaults to enabling both sorts.
* @returns {string} Markup with requested sorting applied.
*/
export function reorderMarkup(html, options);Provides HTML minification with frequency-based attribute and class token sorting.
Install with Tessl CLI
npx tessl i tessl/npm-html-minifierdocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9