Compressors
HTML Minifier

html-minifier

html-minifier can compress only HTML files.

https://github.com/kangax/html-minifier (opens in a new tab)

Usage

const minify = require('@node-minify/core');
const htmlMinifier = require('@node-minify/html-minifier');
 
minify({
  compressor: htmlMinifier,
  input: 'foo.html',
  output: 'bar.html',
  callback: function(err, min) {}
});

Options

minify({
  compressor: htmlMinifier,
  input: 'foo.html',
  output: 'bar.html',
  options: {
    removeAttributeQuotes: true
  },
  callback: function(err, min) {}
});

Check all options (opens in a new tab)

Last updated on December 5, 2022