esprima

ECMAScript parsing infrastructure for multipurpose analysis

Github星跟踪图

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.

主要指标

概览
名称与所有者jquery/esprima
主编程语言TypeScript
编程语言JavaScript (语言数: 2)
平台
许可证BSD 2-Clause "Simplified" License
所有者活动
创建于2011-11-23 05:36:43
推送于2023-04-16 01:17:08
最后一次提交
发布数32
最新版本名称4.0.1 (发布于 2018-06-16 07:37:49)
第一版名称1.0.0 (发布于 2012-10-22 05:17:08)
用户参与
星数7.1k
关注者数146
派生数777
提交数1.2k
已启用问题?
问题数659
打开的问题数138
拉请求数104
打开的拉请求数10
关闭的拉请求数667
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?