Registry / devops / abridge

abridge

JSON →
library0.5.3jsnpmunverified

Abridge is a streaming minifier for JS and CSS, forked from node-minify (v0.5.3). It improves on the original by using streams, piping to child process stdin instead of temp files, and dropping support for Google Closure Compiler. The API preserves the old style but adds a simpler minify() function with a callback that receives minified data. Supports UglifyJS (default for JS) and YUI Compressor (default for CSS, requires Java). Currently in maintenance status; last release was in 2016.

npm install abridge
INSTALL
IMPORT
SIG · ABRIDGE
A
abridge
devopsjavascriptv0.5.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.

abridge
const abridge = require('abridge'); abridge.minify(...)
import abridge from 'abridge';
Package uses CommonJS; ESM import not supported.
Minifier
const Minifier = require('abridge').Minifier;
import { Minifier } from 'abridge';
Legacy class; consider using abridge.minify() instead.
abridge.minify
const abridge = require('abridge'); abridge.minify(options, callback)
abridge.minify('file.js', 'file.min.js', callback) assumes old signature
Multiple calling conventions exist; check README.

Demonstrates three calling conventions: simple file+callback, multiple files, and options object.

const abridge = require('abridge'); // Minify a single JS file with callback getting data abridge.minify('input.js', function(err, data) { if (err) console.error(err); else console.log('Minified JS:', data); }); // Minify multiple files to one output abridge.minify(['file1.js', 'file2.js'], 'output.js', function(err) { if (err) console.error(err); else console.log('Minified to output.js'); }); // Full options object abridge.minify({ type: 'yui', fileIn: 'style.css', fileOut: 'style.min.css', callback: function(err, data) { if (err) console.error(err); else console.log('Minified CSS:', data); } });
Debug
Known issues
gotchaYUI Compressor requires Java installed on the system. Without Java, CSS minification will fail silently or throw an error.
fix
Install Java Runtime Environment (JRE) and ensure 'java' is in PATH, or use only JavaScript files.
affects: >=0.0.0
deprecatedThe Minifier class constructor is deprecated; use the minify() function instead.
fix
Replace 'new Minifier({...})' with 'abridge.minify({...})'.
affects: >=0.5.0
gotchaCallback signature changed; legacy callbacks may not receive the minified data as second argument. Newer versions provide (err, data) instead of just (err).
fix
Update callbacks to accept a second argument: function(err, data).
affects: >=0.5.0
gotchaIf fileIn is a single string but fileOut is an array, behavior is undefined. Check argument types carefully.
fix
Ensure fileIn is an array when providing multiple files, or a string for single file.
affects: >=0.5.0
Errors
Common errors & fixes
Error: Java not found. Please install Java to use YUI Compressor.
YUI Compressor requires Java runtime, which is not installed or not in PATH.
fix
Install Java JRE (e.g., 'apt-get install default-jre' on Debian/Ubuntu) and ensure 'java' command works.
TypeError: abridge.minify is not a function
Incorrect import style; package does not support ES module import.
fix
Use CommonJS require: const abridge = require('abridge');
Callback never called or no data returned
Using old Minifier class constructor without providing proper callback or misusing new API.
fix
Use abridge.minify() with a callback function(err, data).
Error: cannot read property 'type' of undefined
Passing incorrect arguments to minify() (e.g., array of filenames without output).
fix
Check argument order: minify(fileIn, fileOut, callback) or minify(options, callback).
Upgrade
Version history
0.5.3latest on npm
Audit
Dependencies
uglify-jsrequiredDefault JavaScript minifier
javaoptionalRequired for CSS minification via YUI Compressor
Agent activity
69 hits · last 30 days
node
60
OpenAI (training)
1
Resources
abridge — npm install abridge · libregistry