Esprima (esprima.org) is an educational ECMAScript (also popularly known as JavaScript) parsing infrastructure for multipurpose analysis. It is also written in ECMAScript.
Esprima is created and maintained by Ariya Hidayat (Twitter: @ariyahidayat), with the help of many contributors.
Features
- Supports ECMAScript 5.1 with an experimental branch for ES.Next/Harmony
- Sensible format for the abstract syntax tree (AST), compatible with Mozilla Parser API
- Heavily tested (> 500 unit tests with solid 100% code coverage)
- Optional tracking of syntax node location (index-based and line-column)
- Blazing fast (3x faster than UglifyJS on the speed comparison test using Chrome)
Esprima runs on web browsers (IE 6+, Firefox 1+, Safari 3+, Chrome 1+, Konqueror 4.6+, Opera 8+) as well as Node.js.
Use-cases
- Smart editing: outline view, content assist
- Source code modification: Esmorph, Code Painter, node-falafel, Esmangle
- Code coverage analysis: node-cover, coveraje, CoverJS, Istanbul
- Code generation: escodegen
- Documentation tool: JFDoc, JSDuck
- Source-to-source compilation: Marv, LLJS, Harmonizr
Feedback and contribution are welcomed! Please join the mailing list and read the contribution guide for further info.