I'm looking to parse JavaScript code into an Abstract Syntax Tree (AST) so I can make some modifications to the source code. I've heard of Babel, but it seems a bit too complex for my needs. Are there any simpler libraries or tools that I could use instead?
2 Answers
Have you ever visited astexplorer.net? It’s a fantastic resource that breaks down the JS AST. What’s cool is that they have a "Transform" button that showcases various libraries and provides code examples you can experiment with. Also, you might consider using JSCodeShift or Recast for your needs!
You might want to check out Acorn! It's a great and lightweight parser for JavaScript that you can use to generate an AST.

Thanks for the tip, I’ll definitely take a look!