AutoMin is a CLI tool that creates minified mirror copies of your JS, CSS, HTML, and JSON files. Version 2.0.3 is the current stable release. It leverages UglifyJS, clean-css, HTML-minifier, and jsonminify under the hood. Key differentiators include global installation, offline capability, use of uglifyjs nameCache for preserving function names across files, automatic skipping of .git and node_modules, and support for custom minifiers by editing a single file. It requires input and output directories and offers overwrite and merge options.
npm install autominNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Installs AutoMin globally and minifies all JS, CSS, HTML, JSON files from ./my-project into ./my-project-min.
Add --merge to your command if you want to keep old files that haven't been processed.
Choose only one of --merge or --overwrite, or omit both.
Rename or modify the source to exclude the .min. pattern, or edit the minifier to include them.
Move the files you want to minify outside of .git or node_modules.
Install globally: npm install -g automin
Provide both --input and --output directories.
Update to the latest version: npm update -g automin