How to use the html-minifier/src/htmllint.HTMLLint function in html-minifier

To help you get started, we’ve selected a few html-minifier examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github DanielRuf / html-minifier-terser / tests / lint.js View on Github external
/* global minify, HTMLLint */
'use strict';

if (typeof minify === 'undefined') {
  self.minify = require('html-minifier').minify;
}
if (typeof HTMLLint === 'undefined') {
  self.HTMLLint = require('html-minifier/src/htmllint').HTMLLint;
}

test('lint exists', function() {
  ok(minify);
  ok(HTMLLint);
});

test('lint is instance of HTMLLint', function() {
  var lint = new HTMLLint();
  ok(lint instanceof HTMLLint);
});

test('lint API', function() {
  var lint = new HTMLLint();
  equal(0, lint.log.length, '`log` property exists');
  equal('function', typeof lint.populate, '`populate` method exists');

html-minifier

Highly configurable, well-tested, JavaScript-based HTML minifier.

MIT
Latest version published 5 years ago

Package Health Score

65 / 100
Full package analysis