Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Tools like acorn[1] and Esprima[2] can parse the JavaScript source and output an ESTree compliant syntax tree.

Then you can traverse it and modify it like any other AST.

[1] https://github.com/ternjs/acorn [2] http://esprima.org/ [3] https://github.com/estree/estree



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: