tag | f3519a2c814abc2b09df1921993a389c64a1f4c7 | |
---|---|---|
tagger | Ariya Hidayat <ariya.hidayat@gmail.com> | Thu Nov 24 07:31:39 2016 -0800 |
object | 23501af8af5721fe1f113e54dcf029cbbcb75bae |
Version 3.1.2
commit | 23501af8af5721fe1f113e54dcf029cbbcb75bae | [log] [tgz] |
---|---|---|
author | Ariya Hidayat <ariya.hidayat@gmail.com> | Tue Nov 22 20:02:32 2016 -0800 |
committer | Ariya Hidayat <ariya.hidayat@gmail.com> | Thu Nov 24 07:28:29 2016 -0800 |
tree | 77323d49c55c0b499d6e600cc43736b9840c41b4 | |
parent | d085ff58f37228502e19734abd660447b7062ceb [diff] |
Stable version 3.1.2 Refs #1584 Closes gh-1635
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.parse(program); { type: 'Program', body: [ { type: 'VariableDeclaration', declarations: [Object], kind: 'const' } ], sourceType: 'script' }