Escodegen is a JavaScript code generator from an abstract syntax tree (AST). It's commonly used in tooling for code transformation, minification, and analysis. It accepts an AST, compliant with the Mozilla Parser API (SpiderMonkey), and generates readable, well-formatted JavaScript code. Escodegen supports various output formatting options, including indentation, semicolons, and line breaks, allowing fine-grained control over the generated code's style and readability, aiding in tasks like debugging or modifying existing JavaScript programs.
The npm package escodegen saw frequent releases in its early years (2012-2015), with multiple versions per month. Release frequency decreased significantly after 2015, with only sporadic releases. There were no releases between August 2020 and June 2023. Version 2.1.0 was released in June 2023. There have been no releases since then (July/August 2025).
Escodegen npm package downloads surged throughout 2024 and early 2025, peaking in June 2025 at over 188 million. July 2025 saw similar numbers, while August 2025 downloads are currently lower, with 77 million, likely due to incomplete monthly data.