Generating JS from AST


#1

Are there any existing generators that can take an ESTree AST and create a string of JavaScript?

The use case I have in mind is to parse JavaScript using Acorn, modify the AST, then regenerate JavaScript.

If not, I’m happy to write it. Thanks!


#2

I think escodegen is the most popular tool for this.