Esprima is a high performance, standard-compliant ECMAScript parser written in ECMAScript (also popularly known as JavaScript).
Esprima runs on web browsers (IE 6+, Firefox 1+, Safari 3+, Chrome 1+, Konqueror 4.6+, Opera 8+) as well as Rhino and Node.js.
Features
- Full support for ECMAScript 5.1 (ECMA-262)
- Sensible syntax tree format, compatible with Mozilla Parser AST
- Heavily tested (> 550 unit tests with solid 100% statement coverage)
- Optional tracking of syntax node location (index-based and line-column)
- Experimental support for ES6/Harmony (module, class, destructuring, ...)
Esprima is blazing fast (see the benchmark suite). It is up to 3x faster than UglifyJS v1 and it is still competitive with the new generation of fast parsers.
Applications
Esprima serves as the basis for many popular JavaScript development tools:- Code coverage analysis: node-cover, Istanbul
- Documentation tool: JFDoc, JSDuck
- Language extension: LLJS (low-level JS), Sweet.js (macro)
- ES6/Harmony transpiler: Six, Harmonizr
- Eclipse Orion smart editing (outline view, content assist)
- Source transformation: node-falafel, Esmangle, escodegen
Feedback is welcomed! Please join the discussion in the mailing list.