JavaScript AST programming: Introduction and beyond
summary
Live coding builds a small CLI that reads a file or stdin, parses JavaScript with acorn into an ESTree-like AST (~400 node kinds mentioned), traverses nodes to detect patterns like console.log and problematic binary + conversions, performs edits (remove logs, replace unsafe plus with Number calls), and prints either transformed code or AST JSON streaming. The pipeline uses a parser, a traversal library and a generator and demonstrates the changes working end to end.
AI-written summary · about
chapters (9)
- 0:00Introduction to JavaScript AST
- 12:27What is an Abstract Syntax Tree
- 16:40Building a JavaScript parser
- 24:08Exploring AST structure
- 30:20Generating code from AST
- 34:38Common AST manipulation patterns
- 38:08Traversing the AST
- 40:24Practical AST use cases
- 43:16Q&A and closing








