Registry / testing / hermione-image-minifier

hermione-image-minifier

JSON →
library0.1.0jsnpmunverified

A plugin for the Hermione test runner that minifies reference images using optipng. Version 0.1.0 is the latest stable release; no release cadence documented. It integrates directly into Hermione's plugin system and offers configurable compression levels (0–7) with CLI/env overrides. Differentiator: reduces PNG reference image sizes automatically after updates.

npm install hermione-image-minifier
INSTALL
IMPORT
SIG · HERMIONE-IMAGE-MIN
H
hermione-image-minifier
testingjavascriptv0.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.

plugin config
// In hermione config: plugins: { 'hermione-image-minifier': { enabled: true } }
// Not imported directly; config must use full npm package name as key.
Plugin is configured via Hermione's plugin system; no JavaScript import needed.

Configures the plugin to automatically minify reference images after they are updated, using compression level 2.

// hermione.config.js module.exports = { system: { plugins: { 'hermione-image-minifier': { enabled: true, compressionLevel: 2 } } } }; // Run after updating reference images: // npx hermione --update-refs
Debug
Known issues
gotchaPlugin only runs when reference images are updated (e.g., --update-refs). It does NOT minify on every test run.
fix
Ensure you pass --update-refs to trigger minification.
affects: >=0.0.1
gotchaoptipng must be installed separately or via optipng-bin dependency; may fail on systems without native binaries.
fix
If optipng-bin fails, install optipng globally (apt-get install optipng, brew install optipng) or use another image minifier plugin.
affects: >=0.0.1
deprecatedRequires Node.js >= 8.0.0, which is end-of-life.
fix
Upgrade Node.js to a modern version (>=12) and verify compatibility; if plugin is unmaintained, consider forking or replacing.
affects: >=0.0.1
gotchaCompression level 7 (maximum) can significantly increase processing time for large images.
fix
Use lower compression levels (2-3) for faster runs if time is critical.
affects: >=0.0.1
gotchaPlugin does not support image formats other than PNG.
fix
Convert other image formats to PNG before using as reference images, or use a different minifier plugin.
affects: >=0.0.1
Errors
Common errors & fixes
Error: Cannot find module 'hermione-image-minifier'
Plugin not installed or not in node_modules.
fix
npm install hermione-image-minifier --save-dev
Plugin 'hermione-image-minifier' not found in plugins
Plugin not listed in system.plugins in hermione config.
fix
Add to config: system.plugins['hermione-image-minifier'] = { enabled: true }
Error: optipng failed with exit code 1
optipng binary missing or broken.
fix
Install optipng system-wide: apt-get install optipng (Linux) or brew install optipng (macOS)
Upgrade
Version history
0.1.0latest on npm
Audit
Dependencies
hermionerequiredpeer dependency; plugin only works within Hermione test runner
optipng-binrequiredbinary dependency for PNG optimization
Agent activity
6 hits · last 30 days
node
6
Resources
hermione-image-minifier — npm install hermione-image-minifier · libregistry