{"id":40538,"library":"abridge","title":"Abridge","description":"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.","status":"maintenance","version":"0.5.3","language":"javascript","source_language":"en","source_url":"https://github.com/Weltschmerz/Abridge","tags":["javascript"],"install":[{"cmd":"npm install abridge","lang":"bash","label":"npm"},{"cmd":"yarn add abridge","lang":"bash","label":"yarn"},{"cmd":"pnpm add abridge","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Default JavaScript minifier","package":"uglify-js","optional":false},{"reason":"Required for CSS minification via YUI Compressor","package":"java","optional":true}],"imports":[{"note":"Package uses CommonJS; ESM import not supported.","wrong":"import abridge from 'abridge';","symbol":"abridge","correct":"const abridge = require('abridge'); abridge.minify(...)"},{"note":"Legacy class; consider using abridge.minify() instead.","wrong":"import { Minifier } from 'abridge';","symbol":"Minifier","correct":"const Minifier = require('abridge').Minifier;"},{"note":"Multiple calling conventions exist; check README.","wrong":"abridge.minify('file.js', 'file.min.js', callback) assumes old signature","symbol":"abridge.minify","correct":"const abridge = require('abridge'); abridge.minify(options, callback)"}],"quickstart":{"code":"const abridge = require('abridge');\n\n// Minify a single JS file with callback getting data\nabridge.minify('input.js', function(err, data) {\n    if (err) console.error(err);\n    else console.log('Minified JS:', data);\n});\n\n// Minify multiple files to one output\nabridge.minify(['file1.js', 'file2.js'], 'output.js', function(err) {\n    if (err) console.error(err);\n    else console.log('Minified to output.js');\n});\n\n// Full options object\nabridge.minify({\n    type: 'yui',\n    fileIn: 'style.css',\n    fileOut: 'style.min.css',\n    callback: function(err, data) {\n        if (err) console.error(err);\n        else console.log('Minified CSS:', data);\n    }\n});","lang":"javascript","description":"Demonstrates three calling conventions: simple file+callback, multiple files, and options object."},"warnings":[{"fix":"Install Java Runtime Environment (JRE) and ensure 'java' is in PATH, or use only JavaScript files.","message":"YUI Compressor requires Java installed on the system. Without Java, CSS minification will fail silently or throw an error.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Replace 'new Minifier({...})' with 'abridge.minify({...})'.","message":"The Minifier class constructor is deprecated; use the minify() function instead.","severity":"deprecated","affected_versions":">=0.5.0"},{"fix":"Update callbacks to accept a second argument: function(err, data).","message":"Callback signature changed; legacy callbacks may not receive the minified data as second argument. Newer versions provide (err, data) instead of just (err).","severity":"gotcha","affected_versions":">=0.5.0"},{"fix":"Ensure fileIn is an array when providing multiple files, or a string for single file.","message":"If fileIn is a single string but fileOut is an array, behavior is undefined. Check argument types carefully.","severity":"gotcha","affected_versions":">=0.5.0"}],"env_vars":null,"search_vec":"'2016':81 'abridg':1,2 'add':48 'api':42 'callback':55 'child':27 'closur':39 'compil':40 'compressor':67 'css':10,70 'current':73 'data':59 'default':62,68 'drop':35 'file':33 'fork':11 'function':52 'googl':38 'improv':18 'instead':30 'java':72 'javascript':82 'js':8,64 'last':77 'mainten':75 'minifi':6,15,51,58 'node':14 'node-minifi':13 'old':45 'origin':21 'pipe':25 'preserv':43 'process':28 'receiv':57 'releas':78 'requir':71 'simpler':50 'status':76 'stdin':29 'stream':5,24 'style':46 'support':36,60 'temp':32 'uglifyj':61 'use':23 'v0.5.3':16 'yui':66","created_at":"2026-06-04T18:48:02.431167+00:00","updated_at":"2026-06-04T18:48:02.431167+00:00","problems":[{"fix":"Install Java JRE (e.g., 'apt-get install default-jre' on Debian/Ubuntu) and ensure 'java' command works.","cause":"YUI Compressor requires Java runtime, which is not installed or not in PATH.","error":"Error: Java not found. Please install Java to use YUI Compressor."},{"fix":"Use CommonJS require: const abridge = require('abridge');","cause":"Incorrect import style; package does not support ES module import.","error":"TypeError: abridge.minify is not a function"},{"fix":"Use abridge.minify() with a callback function(err, data).","cause":"Using old Minifier class constructor without providing proper callback or misusing new API.","error":"Callback never called or no data returned"},{"fix":"Check argument order: minify(fileIn, fileOut, callback) or minify(options, callback).","cause":"Passing incorrect arguments to minify() (e.g., array of filenames without output).","error":"Error: cannot read property 'type' of undefined"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/Weltschmerz/Abridge","github":"https://github.com/Weltschmerz/Abridge","docs":null,"changelog":null,"pypi":null,"npm":"abridge","openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-04","next_check":"2026-09-02","install_tag":null}}