Registry / devops / autominify

autominify

JSON →
library0.0.2jsnpmunverified

Express middleware that auto-minifies JavaScript files on request, serving minified versions with caching. Version 0.0.2 is the latest and only release, with no active development or updates. Supports multiple minifiers including Google Closure Compiler, YUI Compressor, UglifyJS, and a no-compress mode. Designed for older Express/Connect setups, with no maintenance or security guarantees.

npm install autominify
INSTALL
IMPORT
SIG · AUTOMINIFY
A
autominify
devopsjavascriptv0.0.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.

autominify
var autominify = require("autominify");
import autominify from 'autominify';
The package does not ship ESM; use CommonJS require. Named export style may not work with default import.
autominify as function
app.use(autominify(path.join(__dirname, 'public', 'js')));
app.use(autominify());
The middleware requires a root directory path as first argument.
second argument for compiler
app.use(autominify(path.join(__dirname, 'public', 'js'), 'uglifyjs'));
app.use(autominify(path.join(__dirname, 'public', 'js'), {type: 'uglifyjs'}));
Compiler is passed as a string, not an options object.

Sets up Express server with autominify middleware for JavaScript minification on the fly.

var express = require('express'); var autominify = require('autominify'); var path = require('path'); var app = express(); var jsDir = path.join(__dirname, 'public', 'js'); app.use(autominify(jsDir)); app.use(express.static('public')); app.listen(3000);
Debug
Known issues
deprecatedPackage is abandoned with no updates since 2012. No security fixes or compatibility updates.
fix
Use a maintained alternative like uglify-js middleware or a build tool (webpack, gulp) for minification.
affects: >=0.0.1
breakingRequires deprecated Express 3.x API (app.use without path). May not work with Express 4+ without adapting route mounting.
fix
For Express 4+, use app.use('/js', autominify(...)) or upgrade to alternative middleware.
affects: >=0.0.0
gotchaThe middleware only minifies files ending in .js (not .min.js) and serves a new minified file. It does not cache based on source file changes.
fix
Manually clear cache if source files change, or use a build tool for production.
affects: >=0.0.0
gotchaThe 'gcc' compiler requires Google's Closure Compiler CLI to be installed separately. Not documented in package.
fix
Ensure java is installed and 'closure-compiler' jar is in PATH, or use 'uglifyjs' which is bundled.
affects: >=0.0.0
gotchaAppending '?autominify=false' is the only way to bypass minification for debugging; there is no option to disable globally.
fix
Set environment variable or remove middleware conditionally for development.
affects: >=0.0.0
Errors
Common errors & fixes
Error: Cannot find module 'autominify'
Package not installed or not available in npm registry
fix
Run 'npm install autominify' and verify node_modules contains it.
TypeError: autominify is not a function
Incorrect import style (ESM vs CJS)
fix
Use 'var autominify = require("autominify");' instead of ES6 import.
Error: spawn java ENOENT
Google Closure Compiler not installed on system
fix
Install Java and closure-compiler.jar, or use 'uglifyjs' as compiler string: autominify(path, 'uglifyjs').
Upgrade
Version history
0.0.2latest on npm
Audit
Dependencies
expressrequiredRequires Express or Connect framework for middleware
Agent activity
10 hits · last 30 days
node
8
OpenAI (training)
1
Resources
autominify — npm install autominify · libregistry