esprima
    Overview
    Documentation
    Tutorials
    Insights
    Code
    Dependencies
    Contributors
    Jobs

esprima

ECMAScript parsing infrastructure for multipurpose analysis

4.0.1  •  Updated 2 years ago  •  by jquery  •  BSD 2-Clause "Simplified" License

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.

Popularity

Weekly Downloads
19.8M
Stars
5.5K

Maintenance

Development

Last ver 2 years ago
Created 8 years ago
Last commit 5 months ago
3 days between commits

Technology

Node version: 8.11.3
314.4K unpacked

Compliance

BSD 2-Clause "Simplified" License
OSI Approved
0 vulnerabilities

Contributors

63 contributors
Ariya Hidayat
Maintainer, 830 commits, 87 merges, 297 PRs
Constellation
42 commits, 100 PRs
ZHANG Bei
Maintainer, 26 commits, 31 PRs
Works at Shape Security
Joost-Wim Boekesteijn
13 commits
Mathias Bynens
12 commits, 14 PRs
Works at Google
Michael Ficarra
10 commits, 10 PRs
Works at shapesecurity

Tags

ast
ecmascript
esprima
javascript
parser
syntax
Openbase helps developers choose among and use millions of open-source packages, so they can build amazing products faster.
FacebookTwitterLinkedIn
© 2020 Devstore, Inc.