esprima

ECMAScript parsing infrastructure for multipurpose analysis

Github stars Tracking Chart

NPM version
npm download
Build Status
Coverage Status

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.

Features

API

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.

Main metrics

Overview
Name With Ownerjquery/esprima
Primary LanguageTypeScript
Program languageJavaScript (Language Count: 2)
Platform
License:BSD 2-Clause "Simplified" License
所有者活动
Created At2011-11-23 05:36:43
Pushed At2023-04-16 01:17:08
Last Commit At
Release Count32
Last Release Name4.0.1 (Posted on 2018-06-16 07:37:49)
First Release Name1.0.0 (Posted on 2012-10-22 05:17:08)
用户参与
Stargazers Count7.1k
Watchers Count146
Fork Count777
Commits Count1.2k
Has Issues Enabled
Issues Count659
Issue Open Count138
Pull Requests Count104
Pull Requests Open Count10
Pull Requests Close Count667
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private