images-minifier
v2.1.0
Published
CLI tool to compress image folders or convert them to WebP
Maintainers
Readme
Images Minifier
images-minifier is a small CLI that copies an image directory, then compresses the copied images or converts them to WebP.
It works on a whole folder at once, so your original images stay untouched.
Installation
npm install -g images-minifierUsage
imini <input_dir> <output_dir>Options
--beautify-dir, -b
Beautify the output directory structure. Default: false
--use-webp, -w
Convert images to .webp instead of compressing their original format.
This now works after a normal npm install with no extra WebP package to install.
Examples
imini ./images ./compressed-imagesConvert everything to WebP:
imini --use-webp ./images ./compressed-imagesBeautify the copied folder structure before processing:
imini --beautify-dir ./images ./compressed-imagesProgrammatic usage
const { minifyImages } = require("images-minifier");
await minifyImages("./compressed-images", { webp: true });Publish checklist
Before publishing:
npm test
npm pack --dry-run
npm publishBuy me a coffee
If you like this tool, consider buying me a coffee. Thanks a bunch!

