tag | ebaa1425350a343a609040322fc1e5f8ed682d5f | |
---|---|---|
tagger | Ariya Hidayat <ariya.hidayat@gmail.com> | Sat Jun 16 07:37:49 2018 -0700 |
object | 0ed4b8afdf2abd416f738977672c6232836f410a |
Version 4.0.1
commit | 0ed4b8afdf2abd416f738977672c6232836f410a | [log] [tgz] |
---|---|---|
author | Ariya Hidayat <ariya.hidayat@gmail.com> | Fri Jun 15 07:11:49 2018 -0700 |
committer | Ariya Hidayat <ariya.hidayat@gmail.com> | Sat Jun 16 07:36:29 2018 -0700 |
tree | 626e96b066846c8fdac16351235539dfac6922ee | |
parent | cb3b14db691366058b692d05934156ad7631b4a4 [diff] |
Stable version 4.0.1 Refs #1589 Closes gh-1940
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.