UglifyJS
github.com
- Free plan
- Linux
- API
- Self-hosted
What UglifyJS is
UglifyJS is a free BSD-licensed toolkit for parsing, minifying, compressing, and beautifying JavaScript. It can be installed from npm for command-line or programmatic use. The command-line tool accepts multiple input files and reads standard input when no file is supplied. Its configurable minify() API processes JavaScript and can return minified code, warnings, or errors. UglifyJS generates source maps and can compose mappings from compiled code back to original source files. It includes AST utilities, imports SpiderMonkey AST input, and can use Acorn as an optional parser. The toolkit supports JavaScript and most ECMAScript features, while its documentation recommends transpiling more unusual syntax with tools such as Babel first. Compatibility options are available for projects needing behavior beyond the defaults. The project documents compiler assumptions and warns that some transformations can change behavior in particular cases. It is available for API, Linux, and self-hosted use, with the listed UglifyJS plan priced at no cost.
Who it suits
UglifyJS suits developers adding JavaScript transformation to build workflows or applications. Its npm, command-line, and API interfaces support both scripted and programmatic use.
Good to know, and what to watch
- Free BSD-licensed software
- Supports command-line and programmatic use
- Generates and composes source maps
- Includes AST utilities
- Accepts multiple input files
- More exotic syntax may need prior transpiling
- Some transformations can alter behavior
- Default compatibility is not proof for several runtimes
Plans
Every plan and priceUglifyJS
Free plan
The verdict
UglifyJS provides JavaScript compression and related parsing tools through npm, a CLI, and an API. Source maps and AST support add workflow options, while syntax and compatibility caveats require attention.
What the maker publishes
- API
- The API provides a configurable minify() function that can process JavaScript and return minified code, warnings or errors. source
- AST tools
- The toolkit includes its own AST utilities and can import SpiderMonkey AST input; Acorn can be used for parsing. source
- CLI
- The command-line tool accepts multiple input files and reads from standard input when no input file is specified. source
- Compatibility limit
- The project says it does not try to be Internet Explorer, Chrome/Node.js V8, or Safari/WebKit proof by default; corresponding compatibility options are available. source
- Install
- The project documents installing UglifyJS from npm for command-line or programmatic use. source
- Integration
- The README documents npm and Node.js usage and describes using Acorn as an optional parser. source
- Intended users
- The documented command-line and programmatic interfaces support developers using UglifyJS in build workflows or applications. source
- Language support
- UglifyJS supports JavaScript and most ECMAScript features, and the README recommends transpiling more exotic syntax with tools such as Babel first. source
- License
- UglifyJS is released under a BSD license. source
- Optimization caveat
- The README documents compiler assumptions and warns that some transformations can alter behavior in particular cases. source
- Purpose
- UglifyJS is a JavaScript parser, minifier, compressor and beautifier toolkit. source
- Security
- The repository has a Security tab, but the opened security page does not state a security policy or compliance certification. source
- Source maps
- UglifyJS can generate source maps and compose mappings from compiled JavaScript back to original source files. source
Checked against the maker's pages on 4 Oct 2026.