commit | ea90f4a93c0f8bfb19c1f101bf19c1ea97a52e6a | [log] [tgz] |
---|---|---|
author | Ariya Hidayat <ariya.hidayat@gmail.com> | Mon Apr 03 21:33:21 2017 -0700 |
committer | Ariya Hidayat <ariya.hidayat@gmail.com> | Thu Apr 06 07:53:39 2017 -0700 |
tree | ff23787ce7792fe8b79ed5ceabdc369cee80db60 | |
parent | 4f08020cc3f2678ca21b00931eef365d49defed9 [diff] |
Use const whenever possible This is also now enforced via TSLint's prefer-const (with TSLint dependency bumped to v5). Fix #1817 Closes gh-1823
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' }
For more information, please read the complete documentation.