esprima3.1.3 • Public • Published
- Full support for ECMAScript 2016 (ECMA-262 7th 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 (~1300 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'