Registry / devops / uglify-lite

uglify-lite

JSON →
library2017.2.19jsnpmunverified

A browser-compatible, zero-dependency JavaScript minifier based on UglifyJS v1.3.5. Version 2017.2.19, released as a snapshot of the ancient UglifyJS 1.x branch. It packages the old minifier for use in both Node.js and browser environments via a bundled rollup file. Key differentiator: no dependencies and includes a CDN-ready bundle, but it's a very old version of UglifyJS (v1 from 2013), lacking ES6+ support and modern optimizations. Release cadence: last published in 2017 and appears abandoned.

npm install uglify-lite
INSTALL
IMPORT
SIG · UGLIFY-LITE
U
uglify-lite
devopsjavascriptv2017.2.19
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.

default
const uglify = require('uglifyjs-lite');
import uglify from 'uglifyjs-lite';
Package does not provide ESM exports; only CommonJS require() works. Browser usage should use the CDN bundle instead.
minify
const uglify = require('uglifyjs-lite'); const result = uglify.minify('code');
const { minify } = require('uglifyjs-lite');
The API exposes `minify` as a method on the default export, not as a named export. The CDN bundle also exposes `uglifyjs.minify`.
parser
const uglify = require('uglifyjs-lite'); const ast = uglify.parser.parse('code');
Access to the parser is available via `uglify.parser.parse()`. This is an internal API from UglifyJS v1.

Shows how to minify a simple function using the Node.js require() and the minify method.

const uglify = require('uglifyjs-lite'); const code = 'function add(a, b) { return a + b; }'; const result = uglify.minify(code); console.log(result); // 'function add(a,b){return a+b}' // For browser, use the CDN bundle: // <script src="https://kaizhu256.github.io/node-uglifyjs-lite/build..beta..travis-ci.org/app/assets.uglifyjs.rollup.js"></script> // then call window.uglifyjs.minify(code);
Debug
Known issues
deprecatedUglifyJS v1.3.5 is extremely outdated. Not maintained since 2013.
fix
Use a modern minifier like terser (recommended) or uglify-js (v3+).
affects: *
gotchaPackage only claims Linux/macOS support. May not work on Windows.
fix
Use a cross-platform minifier like terser.
affects: *
gotchaThe CDN link in the README points to a beta branch build; may be unstable or change without notice.
fix
Pin to a specific version or host your own copy.
affects: *
breakingNo ES6+ syntax support. Will throw errors on arrow functions, classes, etc.
fix
Use terser which supports modern JavaScript.
affects: *
gotchaPackage name 'uglifyjs-lite' is easily confused with 'uglify-js' (official) or 'uglifyjs' (other forks).
fix
Double-check you are using the intended package.
affects: *
Errors
Common errors & fixes
SyntaxError: Unexpected token: punc ())
Input code contains ES6+ syntax like arrow functions that UglifyJS v1 cannot parse.
fix
Use a modern minifier (e.g., terser) that supports ES6+.
Module not found: Can't resolve 'uglifyjs-lite'
Attempting to import the package in a bundler that expects ESM, but package only provides CJS.
fix
Use require('uglifyjs-lite') or configure bundler to handle CJS.
Upgrade
Version history
2017.2.19latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
36 hits · last 30 days
node
36
Resources
uglify-lite — npm install uglify-lite · libregistry