- Full support for ECMAScript 2017 (ECMA-262 8th Edition)
- Sensible syntax tree format as standardized by ESTree project
- Experimental support for JSX, a syntax extension for React
- Optional tracking of syntax node location (index-based and line-column)
- Heavily tested (~1500 unit tests with full code coverage)
A simple example on Node.js REPL:
> var esprima = ;> var program = 'const answer = 42';> esprima;type: 'Keyword' value: 'const'type: 'Identifier' value: 'answer'type: 'Punctuator' value: '='type: 'Numeric' value: '42'> esprima;type: 'Program'body:type: 'VariableDeclaration'declarations: Objectkind: 'const'sourceType: 'script'
For more information, please read the complete documentation.