awesome-repositories.com
Blog
MCP
awesome-repositories.com

Découvrez les meilleurs dépôts open-source grâce à notre recherche par IA.

ExplorerRecherches sélectionnéesAlternatives open sourceLogiciels auto-hébergésBlogPlan du site
ProjetÀ proposNotre méthodologiePresseServeur MCP
Mentions légalesConfidentialitéConditions d'utilisation
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
·
terser avatar

terser/terser

0
View on GitHub↗
9,299 stars·455 forks·JavaScript·9 vuesterser.org↗

Terser

Terser is a JavaScript minifier and compressor designed to reduce file size through whitespace removal, symbol mangling, and logic optimization for ES6+. It functions as a toolkit for minification, a code mangler for shortening variable and property names, and a dead code eliminator that evaluates constant expressions to remove unreachable logic.

The project operates as an AST toolkit that parses JavaScript source into SpiderMonkey AST format for structural analysis. It generates source maps to link compressed production code back to the original source, ensuring that minified bundles remain debuggable.

The system provides capabilities for code optimization, including function inlining, constant expression evaluation, and the removal of unused code or console logs. It supports conditional compilation via global constants and allows for the preservation of specific comments through regular expressions. Additionally, it can be used to beautify JavaScript code or export structured AST data for use with other analysis tools.

Features

  • Code Minifiers - Reduces JavaScript file size by removing whitespace, renaming symbols, and optimizing logic patterns.
  • JavaScript Minifiers - Provides a comprehensive toolkit for reducing JavaScript file size via whitespace removal, symbol mangling, and logic optimization.
  • JavaScript AST Transformations - Converts source code into a structured tree format to perform program analysis and structural changes.
  • Dead Code Elimination - Identifies and removes unused code modules, variables, and unreachable logic from production bundles.
  • Source Map Composers - Composes source maps by tracking character offsets through every transformation to enable debugging of minified code.
  • Constant-Folding Optimizations - Performs constant-folding optimizations by evaluating static expressions at build time to remove unreachable logic.
  • Identifier Manglers - Shortens variable and property names to minimize bundle size while preserving functional integrity.
  • Modern Syntax - Supports modern JavaScript syntax, ensuring the latest language features are correctly parsed into the AST.
  • Multi-Pass Compiler Pipelines - Utilizes a multi-pass compiler pipeline to sequentially perform parsing, constant folding, and dead code elimination.
  • Property Manglers - Rename object properties using regular expressions or a cache to reduce the overall output size.
  • Property Name Manglers - Shortens object property names to reduce bundle size while preserving specific reserved identifiers.
  • JavaScript Source Parsers - Ships a specialized JavaScript source parser that converts code into a structured tree for optimization.
  • Variable Name Manglers - Minimizes code size by replacing long variable and function identifiers with shorter sequences.
  • AST Traversers - Employs recursive tree traversal to identify and replace optimizable patterns within the JavaScript AST.
  • Production Code Shrinkers - Deletes unreachable code, unused variables, and unused parameters to shrink the final production footprint.
  • Internal Tree Representations - Uses the SpiderMonkey AST as the internal tree representation for JavaScript structural analysis and transformation.
  • Identifier Renaming - Implements an identifier mangling map to consistently rename variables across scopes for size reduction.
  • JavaScript Minification - Reduces JavaScript bundle size through whitespace removal and identifier optimization.
  • Logic Compression - Implements advanced structural rewriting to remove redundant logic and simplify JavaScript expressions.
  • SpiderMonkey AST Implementations - Parses JavaScript source into SpiderMonkey AST format for structural analysis and export.
  • Static Expression Evaluation - Computes the values of constant expressions and initializers during the build phase to optimize the output.
  • Code Comment Preservers - Retains essential legal notices or documentation in the output based on regular expressions.
  • External AST Importers - Includes an external AST importer that allows JavaScript code to be ingested via structured JSON objects.
  • Minification Optimizers - Provides minification optimizers that use inline markers to determine which code blocks to optimize or preserve.
  • Code Beautifiers - Provides a beautifier to reformat condensed or minified code into a human-readable layout.
  • Source Map Generators - Generates mapping files that link minified output back to original source code for debugging.
  • AST Data Export - Exports the structured SpiderMonkey AST as JSON for use in external static analysis tools.
  • Comment Preservation Filters - Provides regex-based filtering to decide which source comments to preserve in the minified output.
  • Conditional Compilation - Performs conditional compilation by replacing variables with constants to eliminate dead code paths.
  • Frontend Asset Pipelines - Optimizes and packages client-side JavaScript assets for production deployment within a build pipeline.
  • Compile-Time Constants - Supports defining compile-time constants to trigger the removal of unreachable conditional compilation blocks.
  • Compilation Directives - Implements compilation directives via inline annotations to mark functions as pure or prevent inlining.
  • Function Inliners - Replaces function calls with the actual function body to eliminate execution overhead and improve processing speed.
  • Function Inlining Controls - Allows developers to use special annotations to control the inlining of specific function calls.
  • Build Tools and Bundlers - Toolkit for parsing, mangling, and compressing JavaScript.
  • Minimizers - parser, mangler and compressor toolkit for ES6+

Historique des stars

Graphique de l'historique des stars pour terser/terserGraphique de l'historique des stars pour terser/terser

Recherche par IA

Explorez plus de dépôts awesome

Décrivez vos besoins en langage naturel — l'IA classe des milliers de projets open source sélectionnés par pertinence.

Start searching with AI

Questions fréquentes

Que fait terser/terser ?

Terser is a JavaScript minifier and compressor designed to reduce file size through whitespace removal, symbol mangling, and logic optimization for ES6+. It functions as a toolkit for minification, a code mangler for shortening variable and property names, and a dead code eliminator that evaluates constant expressions to remove unreachable logic.

Quelles sont les fonctionnalités principales de terser/terser ?

Les fonctionnalités principales de terser/terser sont : Code Minifiers, JavaScript Minifiers, JavaScript AST Transformations, Dead Code Elimination, Source Map Composers, Constant-Folding Optimizations, Identifier Manglers, Modern Syntax.

Quelles sont les alternatives open-source à terser/terser ?

Les alternatives open-source à terser/terser incluent : mishoo/uglifyjs — UglifyJS is a tool for JavaScript code minification, AST manipulation, and source beautification. Its primary purpose… mishoo/uglifyjs2 — UglifyJS2 is a suite of tools designed for parsing, beautifying, mangling, and minifying JavaScript code. It functions… swc-project/swc — This project is a high-performance compiler written in Rust that transpiles TypeScript and ECMAScript into compatible… google/closure-compiler — This project is a JavaScript optimizer, minifier, module bundler, transpiler, and static analysis tool. It provides a… web-infra-dev/oxc — oxc is a high-performance JavaScript toolchain developed in Rust for parsing, transforming, and analyzing JavaScript… babel/minify — This project is an AST-based code optimizer and compressor for modern ECMAScript, JSX, and TypeScript source code. It…

Alternatives open source à Terser

Projets open source similaires, classés selon le nombre de fonctionnalités partagées avec Terser.
  • mishoo/uglifyjsAvatar de mishoo

    mishoo/UglifyJS

    13,392Voir sur GitHub↗

    UglifyJS is a tool for JavaScript code minification, AST manipulation, and source beautification. Its primary purpose is to reduce the file size of JavaScript source code by removing whitespace and shortening variable names to optimize frontend build assets. The project differentiates itself through its ability to programmatically analyze and transform code using abstract syntax trees. It performs constant folding analysis and conditional compilation to eliminate unreachable or redundant code, and it employs a multi-pass compression pipeline to maximize total file size reduction. The tool pr

    JavaScript
    Voir sur GitHub↗13,392
  • mishoo/uglifyjs2Avatar de mishoo

    mishoo/UglifyJS2

    13,392Voir sur GitHub↗

    UglifyJS2 is a suite of tools designed for parsing, beautifying, mangling, and minifying JavaScript code. It functions by converting source code into an abstract syntax tree to enable programmatic analysis and transformation, and it includes a dedicated generator for creating associated source maps. The project optimizes web production builds by compressing script logic and removing unreachable code. It utilizes name mangling to shorten variable and property names and implements a beautifier to reconstruct compressed scripts into a human-readable layout. The toolset covers broad capability a

    JavaScript
    Voir sur GitHub↗13,392
  • swc-project/swcAvatar de swc-project

    swc-project/swc

    33,909Voir sur GitHub↗

    This project is a high-performance compiler written in Rust that transpiles TypeScript and ECMAScript into compatible JavaScript code. It functions as a TypeScript transpiler, a JavaScript minifier, and a JavaScript bundler. The system distinguishes itself through a WebAssembly plugin host that allows the execution of custom transformation rules without modifying the core binary. It also provides specialized compilation for React source code to improve runtime performance and reduce execution overhead. The broader capability surface includes source-to-source compilation, type annotation stri

    Rustbabelcompilerecmascript
    Voir sur GitHub↗33,909
  • google/closure-compilerAvatar de google

    google/closure-compiler

    7,663Voir sur GitHub↗

    This project is a JavaScript optimizer, minifier, module bundler, transpiler, and static analysis tool. It provides a compilation pipeline designed to shrink file sizes and improve runtime performance. The system utilizes a multi-pass compilation process to perform dead code elimination, global name mangling, and static type inference. It identifies unreachable functions and unused variables to reduce the final output size and detects potential runtime errors without executing the code. The tool manages assets through dependency resolution, code chunking, and bundle management. It ensures co

    JavaScript
    Voir sur GitHub↗7,663
Voir les 30 alternatives à Terser→