esprima (4.0.1)

Published 2026-02-24 13:56:21 +00:00 by atheaadmin

Installation

registry=
npm install esprima@4.0.1
"esprima": "4.0.1"

About this package

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.

Dependencies

Development Dependencies

ID Version
codecov.io ~0.1.6
escomplex-js 1.2.0
everything.js ~1.0.3
glob ~7.1.0
istanbul ~0.4.0
json-diff ~0.3.1
karma ~1.3.0
karma-chrome-launcher ~2.0.0
karma-detect-browsers ~2.2.3
karma-edge-launcher ~0.2.0
karma-firefox-launcher ~1.0.0
karma-ie-launcher ~1.0.0
karma-mocha ~1.3.0
karma-safari-launcher ~1.0.0
karma-safaritechpreview-launcher ~0.0.4
karma-sauce-launcher ~1.1.0
lodash ~3.10.1
mocha ~3.2.0
node-tick-processor ~0.0.2
regenerate ~1.3.2
temp ~0.8.3
tslint ~5.1.0
typescript ~2.3.2
typescript-formatter ~5.1.3
unicode-8.0.0 ~0.7.0
webpack ~1.14.0

Keywords

ast ecmascript esprima javascript parser syntax
Details
npm
2026-02-24 13:56:21 +00:00
1
Ariya Hidayat
BSD-2-Clause
latest
51 KiB
Assets (1)
Versions (2) View all
4.0.1 2026-02-24
1.2.2 2026-02-24