Start by installing the HTML minifier with:
npm install html-minifier -g
Execute the minifier command:
html-minifier --minify-css true --minify-js true input.htm -o output.htm
Additional options:
html-minifier --collapse-whitespace --remove-comments --remove-optional-tags --remove-redundant-attributes --remove-script-type-attributes --remove-tag-whitespace --use-short-doctype --minify-css true --minify-js true input.htm output.htm