tag | e791e0beae1422d8ddc0309e6f400fd35bf49366 | |
---|---|---|
tagger | Ariya Hidayat <ariya.hidayat@gmail.com> | Sat Jun 10 04:49:08 2017 -0700 |
object | 56c0f0f7248c8611cb55cb97ad089cb86cf8ddb3 |
Version 4.0.0
commit | 56c0f0f7248c8611cb55cb97ad089cb86cf8ddb3 | [log] [tgz] |
---|---|---|
author | Ariya Hidayat <ariya.hidayat@gmail.com> | Thu Jun 08 23:10:58 2017 -0700 |
committer | Ariya Hidayat <ariya.hidayat@gmail.com> | Sat Jun 10 04:45:56 2017 -0700 |
tree | 3976fb53d3202f877afdfc3b9d9ed3df0593433f | |
parent | d95fac62108c4a45139c4fe60c6c3155f585342a [diff] |
Stable version 4.0.0 Refs #1589 Closes gh-1838
Esprima (esprima.org, BSD license) is a high performance, standard-compliant ECMAScript parser written in ECMAScript (also popularly known as JavaScript). Esprima is created and maintained by Ariya Hidayat, with the help of many contributors.
Esprima can be used to perform lexical analysis (tokenization) or syntactic analysis (parsing) of a JavaScript program.
A simple example on Node.js REPL:
> var esprima = require('esprima'); > var program = 'const answer = 42'; > esprima.tokenize(program); [ { type: 'Keyword', value: 'const' }, { type: 'Identifier', value: 'answer' }, { type: 'Punctuator', value: '=' }, { type: 'Numeric', value: '42' } ] > esprima.parseScript(program); { type: 'Program', body: [ { type: 'VariableDeclaration', declarations: [Object], kind: 'const' } ], sourceType: 'script' }
For more information, please read the complete documentation.