I'm looking for help on parsing JavaScript code into an Abstract Syntax Tree (AST) and then making changes to the source code. I've heard about Babel, but honestly, it seems a bit complicated for what I want to do. Are there any simpler alternatives I can use?
2 Answers
There's a really handy site called astexplorer.net. It breaks down JavaScript ASTs and lets you play around with different libraries for transformations. You might find options like JSCodeShift or Recast useful there. Give it a shot!
You can check out Acorn if that's your thing! It's a straightforward parser that can help you get started without too much fuss.
Thanks, bro!