Registry / devops / impresser-html-minifier

impresser-html-minifier

JSON →
library0.1.2jsnpmunverified

A simple HTML minifier library for Node.js, version 0.1.2. This lightweight package removes whitespace, comments, and redundant attributes from HTML strings to reduce file size. It is part of the Impresser ecosystem from Icons8. As an early-stage release (v0.1.x, no stable release cadence), it offers basic minification without advanced options like custom rules or source maps. Compared to popular alternatives (html-minifier, html-minifier-terser), Impresser is minimal with fewer features, suitable for quick minification tasks where full configurability is not required.

npm install impresser-html-minifier
INSTALL
IMPORT
SIG · IMPRESSER-HTML-MIN
I
impresser-html-minifier
devopsjavascriptv0.1.2
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.

default
import minify from 'impresser-html-minifier'
const minify = require('impresser-html-minifier')
ESM module; default export is the minify function.
minify
import { minify } from 'impresser-html-minifier'
const minify = require('impresser-html-minifier').minify
Named export also available; ensure you use named import if using that syntax.
minify
import * as htmlMinifier from 'impresser-html-minifier'; htmlMinifier.minify(html)
const htmlMinifier = require('impresser-html-minifier'); htmlMinifier.minify(html)
Namespace import works; CommonJS require may not work in ESM-only environments.

Basic usage of impresser-html-minifier to minify an HTML string, removing whitespace and comments.

import minify from 'impresser-html-minifier'; const html = ` <!DOCTYPE html> <html> <head> <title>Test</title> </head> <body> <h1>Hello</h1> </body> </html> `; const minifiedHtml = minify(html); console.log(minifiedHtml); // Output: <!DOCTYPE html><html><head><title>Test</title></head><body><h1>Hello</h1></body></html>
Debug
Known issues
gotchaIn early development (v0.1.x); API may change without major version bump.
fix
Pin to exact version if stability is critical.
affects: >=0.1.0
gotchaOnly ES module support; CommonJS require() will fail unless using a bundler that handles ESM.
fix
Use import syntax or configure your project for ESM interoperability.
affects: >=0.1.0
deprecatedNo known deprecations yet due to early version.
fix
Monitor releases for upcoming changes.
affects: >=0.1.0
Errors
Common errors & fixes
ERR_REQUIRE_ESM: require() of ES Module
Using require() on an ESM-only package.
fix
Change to import or use dynamic import().
ERR_MODULE_NOT_FOUND: Cannot find module 'impresser-html-minifier'
Package not installed or not in node_modules.
fix
Run 'npm install impresser-html-minifier'.
TypeError: minify is not a function
Incorrect import style (e.g., using default import on named export).
fix
Use 'import minify from ...' or 'import { minify } from ...' appropriately.
Upgrade
Version history
0.1.2latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
impresser-html-minifier — npm install impresser-html-minifier · libregistry