Registry / devops / task-htmlminifier

task-htmlminifier

JSON →
library0.1.0jsnpmunverified

A task-based wrapper around html-minifier for minifying HTML files. Version 0.1.0, released July 2014. No further updates. Provides a simple `run()` method for batch minification with full html-minifier options. Differentiated by its task-oriented API, but limited documentation and no active maintenance.

npm install task-htmlminifier
INSTALL
IMPORT
SIG · TASK-HTMLMINIFIER
T
task-htmlminifier
devopsjavascriptv0.1.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

task-htmlminifier
const HtmlMinifierTask = require('task-htmlminifier');
import HtmlMinifierTask from 'task-htmlminifier';
CommonJS only; no ESM support.
task instance
const task = new HtmlMinifierTask();
const task = HtmlMinifierTask();
Constructor must be called with `new`.
run method
task.run(inputs, options, logger)
task.htmlminifier(inputs, options)
The only API method is `run`; no other methods.

Basic usage: create instance, define inputs and options, then call run().

const HtmlMinifierTask = require('task-htmlminifier'); const htmlminifier = new HtmlMinifierTask(); const inputs = ['index.html', 'about.html']; const options = { removeComments: true, collapseWhitespace: true }; const logger = console; htmlminifier.run(inputs, options, logger);
Debug
Known issues
deprecatedPackage is no longer maintained since 2014.
fix
Use modern alternatives like html-minifier directly or html-minifier-terser.
affects: >=0.1.0
gotchaThe 'run()' method does not return a promise; it relies on the logger for callbacks.
fix
Wrap run() in a Promise or use async/await with a callback logger.
affects: >=0.1.0
gotchaOptions are passed directly to html-minifier; malformed options cause silent failures.
fix
Validate options against html-minifier documentation before passing.
affects: >=0.1.0
Errors
Common errors & fixes
TypeError: htmlminifier.run is not a function
Instantiated without 'new' or wrong export usage.
fix
Use 'new HtmlMinifierTask()' and ensure correct require.
Cannot find module 'html-minifier'
Dependency 'html-minifier' not installed.
fix
Run 'npm install html-minifier'.
ReferenceError: inputs is not defined
Inputs argument not provided or undefined.
fix
Pass an array of file paths to the run method.
Upgrade
Version history
0.1.0latest on npm
Audit
Dependencies
html-minifierrequiredCore minification logic
Agent activity
8 hits · last 30 days
node
8
Resources
task-htmlminifier — npm install task-htmlminifier · libregistry