A JavaScript parser, mangler, and compressor toolkit for ES6+ that minifies code to reduce file size.
Terser is a JavaScript minification tool that parses, compresses, and mangles ES6+ code to reduce file size and improve load times. It is a fork of uglify-es, designed to support modern JavaScript syntax while maintaining API compatibility. It solves the problem of large JavaScript bundles by applying optimizations like dead code removal, variable renaming, and expression simplification.
JavaScript developers and build engineers who need to optimize production code for web applications, particularly those using ES6+ features and module bundlers like Rollup or Webpack.
Developers choose Terser for its robust ES6+ support, active maintenance, and extensive configuration options that allow fine-tuned control over minification. It is the go‑to replacement for unmaintained tools like uglify‑es, offering better compatibility and smaller output.
🗜 JavaScript parser, mangler and compressor toolkit for ES6+
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Terser fully parses and compresses modern JavaScript syntax including ES6 modules, arrow functions, and classes, making it ideal for contemporary codebases.
Offers extensive control via CLI and API with options for compression, mangling, and formatting, allowing fine-tuned optimization for specific needs.
Produces source maps for debugging minified code, with support for composed maps from compilers like CoffeeScript, enhancing developer experience.
As a fork of the unmaintained uglify-es, Terser is actively updated, ensuring compatibility with new JavaScript features and ecosystem tools.
The property mangling feature can easily break code if not configured correctly, and the README strongly cautions against its use without full understanding.
Terser is deprecating and removing code beautification, forcing users to rely on external tools like prettier for formatting, which adds complexity.
Makes assumptions about built-in functions and browser behavior for optimizations, which might not hold in all environments, potentially leading to bugs.
Terser is an open-source alternative to the following products:
uglify-js is a JavaScript parser, minifier, compressor, and beautifier toolkit that works with ES5 syntax, used to reduce JavaScript file sizes and optimize code for production deployment. It's one of the most popular JavaScript minification tools.
uglify-es was a JavaScript parser, minifier, compressor, and beautifier toolkit that supported ES6+ syntax, but it has been deprecated in favor of terser. It was used to reduce file sizes and optimize JavaScript code for production.