Registry / devops / html-minifier-cli

html-minifier-cli

JSON →
library0.1.0jsnpmunverified

Command-line interface for html-minifier (version 0.1.0), a tool that minifies HTML files to reduce size. Provides a CLI wrapper around the html-minifier library, offering options to customize minification behavior. Supports output file specification and usage help. Lightweight wrapper with no active updates since 2018; useful for simple minification tasks but lacks advanced features like streaming or bundle integration.

npm install html-minifier-cli
INSTALL
IMPORT
SIG · HTML-MINIFIER-CLI
H
html-minifier-cli
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.

cli
import { execSync } from 'child_process'; execSync('htmlmin -o output.html input.html', { stdio: 'inherit' })
const htmlmin = require('html-minifier-cli'); htmlmin.minifyFile(...)
There is no programmatic API; the package only exposes a CLI binary. Use child_process to invoke it.
htmlmin binary
npm install -g html-minifier-cli htmlmin -h
npx html-minifier-cli
This package does not support npx due to missing bin entry configuration. Use global install or full path.
html-minifier library
import { minify } from 'html-minifier'; minify(html, options)
import htmlmin from 'html-minifier-cli'
If you need a programmatic API, use the core package html-minifier directly.

Installs the CLI tool globally and minifies an HTML file, showing output and help commands.

npm install -g html-minifier-cli htmlmin -o minified.html input.html # For help: htmlmin -h
Debug
Known issues
deprecatedPackage is unmaintained since 2018 and may have security vulnerabilities in dependencies.
fix
Consider alternatives like html-minifier-terser, html-minifier-watch, or using html-minifier programmatically.
affects: >=0.0.0
gotchaThe package does not support npx execution because it lacks a bin script in package.json.
fix
Install globally with npm install -g html-minifier-cli, then run htmlmin.
affects: =0.1.0
gotchaNo programmatic API; the package only provides a CLI binary.
fix
Use child_process to invoke the binary, or switch to the html-minifier package for a JavaScript API.
affects: =0.1.0
Errors
Common errors & fixes
Error: Cannot find module 'html-minifier-cli'
Package not installed globally or locally when using npx.
fix
Run npm install -g html-minifier-cli to install globally.
htmlmin: command not found
Global installation path not in PATH after npm install -g.
fix
Check npm global bin path (npm bin -g) and add to PATH, or reinstall with npm install -g html-minifier-cli.
TypeError: htmlmin.minify is not a function
Trying to import the package programmatically when it only exports a CLI binary.
fix
Use child_process to invoke the CLI or import the html-minifier package directly.
Upgrade
Version history
0.1.0latest on npm
Audit
Dependencies
html-minifierrequiredCore library providing the actual minification logic.
commanderrequiredUsed for CLI argument parsing.
Agent activity
4 hits · last 30 days
node
4
Resources
html-minifier-cli — npm install html-minifier-cli · libregistry