tag | 0c8b96cc8d18d76e88b428a124caded399b58786 | |
---|---|---|
tagger | Ariya Hidayat <ariya.hidayat@gmail.com> | Sun Oct 09 10:34:40 2016 -0700 |
object | 8411f93b57d868a26eea3430960978bacd0a61c6 |
Version 3.1.0
commit | 8411f93b57d868a26eea3430960978bacd0a61c6 | [log] [tgz] |
---|---|---|
author | Ariya Hidayat <ariya.hidayat@gmail.com> | Fri Oct 07 07:48:31 2016 -0700 |
committer | Ariya Hidayat <ariya.hidayat@gmail.com> | Sat Oct 08 08:58:08 2016 -0700 |
tree | f9a7a40c0d020a42027f37ec4f94808858fc3057 | |
parent | 0bcbc5ba2b0bd3ee7119dbfcd027e270f20853ca [diff] |
Stable version 3.1.0 Refs #1584 Closes gh-1586
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' }