Convert AST back to javascript code

Hello, I would like to parse the AST, make some changes, then output it to a javascript file that can be interpreted. Is there a method built into acorn for this? Anyone have advice for going about this? I am thinking about utilizing the start and end to re write the file.

No, but something like astring might help here.

Neat! I may have a use for that, will post update soon

I needed to update outdated syntax to new syntax for a bunch of repositories so they could use newer versions of the Hapi framework. Was able to automate this using acorn by searching the AST for specific attributes then applying the correct changes. The contents of the file were stored as a string, so I would slice the string using the start and end positions to remove the outdated syntax and replace it with the new syntax. Automated the process and saved me a lot of time. Thanks for open sourcing this package!!