MCPcopy
hub / github.com/jquery/esprima

github.com/jquery/esprima @4.0.1 sqlite

repository ↗ · DeepWiki ↗ · release 4.0.1 ↗
1,837 symbols 4,056 edges 1,630 files 194 documented · 11%
README

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.

Extension points exported contracts — how you extend this code

Comment (Interface)
(no doc)
src/comment-handler.ts
Position (Interface)
(no doc)
src/scanner.ts
MetaJSXElement (Interface)
(no doc)
src/jsx-parser.ts
Config (Interface)
(no doc)
src/parser.ts
BufferEntry (Interface)
(no doc)
src/tokenizer.ts
TemplateElementValue (Interface)
(no doc)
src/nodes.ts
Entry (Interface)
(no doc)
src/comment-handler.ts
SourceLocation (Interface)
(no doc)
src/scanner.ts

Core symbols most depended-on inside this repo

push
called by 451
src/tokenizer.ts
match
called by 223
src/parser.ts
finalize
called by 137
src/parser.ts
expect
called by 104
src/parser.ts
nextToken
called by 94
src/parser.ts
forEach
called by 90
test/3rdparty/angular-1.2.5.js
get
called by 84
test/fixtures/es2017/async/methods/class-async-get.js
createNode
called by 71
src/parser.ts

Shape

Function 1,063
Method 380
Class 373
Interface 19
Enum 2

Languages

TypeScript100%

Modules by API surface

test/3rdparty/angular-1.2.5.js314 symbols
src/nodes.ts217 symbols
src/parser.ts134 symbols
test/3rdparty/benchmark.js83 symbols
test/3rdparty/jquery-1.9.1.js80 symbols
test/3rdparty/jquery.mobile-1.4.2.js72 symbols
test/3rdparty/mootools-1.4.5.js58 symbols
src/scanner.ts42 symbols
src/jsx-parser.ts38 symbols
src/jsx-nodes.ts33 symbols
test/3rdparty/yui-3.12.0.js22 symbols
src/tokenizer.ts13 symbols

Dependencies from manifests, versioned

codecov.io0.1.6 · 1×
escomplex-js1.2.0 · 1×
everything.js1.0.3 · 1×
glob7.1.0 · 1×
istanbul0.4.0 · 1×
json-diff0.3.1 · 1×
karma1.3.0 · 1×
karma-chrome-launcher2.0.0 · 1×
karma-detect-browsers2.2.3 · 1×
karma-edge-launcher0.2.0 · 1×
karma-firefox-launcher1.0.0 · 1×
karma-ie-launcher1.0.0 · 1×

For agents

$ claude mcp add esprima \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact