esprima
ECMAScript parsing infrastructure for multipurpose analysis
Last updated 7 years ago by ariya .
BSD-2-Clause · Repository · Bugs · Original npm · Tarball · package.json
$ gnpm install esprima 
SYNC missed versions from official npm registry.

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.

Current Tags

  • 1.1.0                                ...           1.1.0 (11 years ago)
  • 4.0.1                                ...           latest (6 years ago)

46 Versions

  • 4.0.1                                ...           6 years ago
  • 4.0.0                                ...           7 years ago
  • 3.1.3                                ...           8 years ago
  • 3.1.2                                ...           8 years ago
  • 3.1.1                                ...           8 years ago
  • 3.1.0                                ...           8 years ago
  • 3.0.0                                ...           8 years ago
  • 2.7.3                                ...           8 years ago
  • 2.7.2                                ...           9 years ago
  • 2.7.1                                ...           9 years ago
  • 2.7.0                                ...           9 years ago
  • 2.6.0                                ...           9 years ago
  • 2.5.0                                ...           9 years ago
  • 2.4.1                                ...           9 years ago
  • 2.4.0                                ...           9 years ago
  • 2.3.0                                ...           9 years ago
  • 2.2.0                                ...           9 years ago
  • 2.1.0                                ...           10 years ago
  • 1.2.5                                ...           10 years ago
  • 2.0.0                                ...           10 years ago
  • 1.2.4                                ...           10 years ago
  • 1.2.3                                ...           10 years ago
  • 1.2.2                                ...           10 years ago
  • 1.2.1                                ...           10 years ago
  • 1.2.0                                ...           10 years ago
  • 1.1.1                                ...           11 years ago
  • 1.1.0                                ...           11 years ago
  • 1.0.4                                ...           11 years ago
  • 1.0.3                                ...           11 years ago
  • 1.0.2                                ...           12 years ago
  • 1.0.1                                ...           12 years ago
  • 1.0.0                                ...           12 years ago
  • 0.9.9                                ...           13 years ago
  • 0.9.8                                ...           13 years ago
  • 0.9.7                                ...           13 years ago
  • 0.9.6                                ...           13 years ago
  • 0.9.5                                ...           13 years ago
  • 0.9.4                                ...           13 years ago
  • 0.9.3                                ...           13 years ago
  • 0.9.2                                ...           13 years ago
  • 0.9.1                                ...           13 years ago
  • 0.9.0                                ...           13 years ago
  • 0.8.2                                ...           13 years ago
  • 0.8.1                                ...           13 years ago
  • 0.8.0                                ...           13 years ago
  • 0.7.0                                ...           13 years ago

Copyright 2013 - present © cnpmjs.org | Home |