Registry / devops / automin

automin

JSON →
library2.0.3jsnpmunverified

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 automin
INSTALL
IMPORT
SIG · AUTOMIN
A
automin
devopsjavascriptv2.0.3
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.

Automin
const automin = require('automin')
import automin from 'automin'
Package does not expose a main module; it is intended as a CLI tool. Use global installation or npx.
CLI usage
automin -i ./src -o ./dist
automin --input ./src --output ./dist --merge --overwrite
The --merge and --overwrite flags cannot be used together. Also, output folder is overwritten by default unless --merge is specified.
Programmatic API
No programmatic API available
const automin = require('automin'); automin.minify(...)
AutoMin is exclusively a CLI tool. There is no exported API for programmatic use.

Installs AutoMin globally and minifies all JS, CSS, HTML, JSON files from ./my-project into ./my-project-min.

npm install -g automin automin -i ./my-project -o ./my-project-min
Debug
Known issues
gotchaOutput folder will be completely overwritten by default, removing any files not in the input. Use --merge to preserve existing files.
fix
Add --merge to your command if you want to keep old files that haven't been processed.
affects: >=1.0.0
breaking--merge and --overwrite cannot be used together. If both provided, the command will fail or behave unexpectedly.
fix
Choose only one of --merge or --overwrite, or omit both.
affects: >=2.0.0
gotchaFiles with .min. before the extension (e.g., .min.js) are skipped by default and will not be minified.
fix
Rename or modify the source to exclude the .min. pattern, or edit the minifier to include them.
affects: >=1.0.0
gotcha.git directories and node_modules are force-skipped. You cannot minify files inside these directories.
fix
Move the files you want to minify outside of .git or node_modules.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'automin'
The package is intended for global CLI use, not as a local module.
fix
Install globally: npm install -g automin
Usage: automin -i <input> -o <output>
Missing required -i or -o flags.
fix
Provide both --input and --output directories.
error: unknown option `--merge'
Using an older version that does not support --merge.
fix
Update to the latest version: npm update -g automin
Upgrade
Version history
2.0.3latest on npm
Audit
Dependencies
uglify-jsrequiredMinifies JavaScript files.
html-minifierrequiredMinifies HTML files.
clean-cssrequiredMinifies CSS files.
jsonminifyrequiredMinifies JSON files.
commanderrequiredParses command line arguments.
mkdirprequiredCreates output directories recursively.
env-resrequiredResolves environment variables.
Agent activity
10 hits · last 30 days
node
8
OpenAI (training)
1
Resources
automin — npm install automin · libregistry