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

NPM version npm download Build Status Coverage Status

NOTE

This fork/clone of esprima tracks the original closely, but adds support for parsing JISON action code blocks, which MAY contain JISON-specific identifiers in the JavaScript code, e.g. $1, @1, #1 and #ID#.

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.parse(program);
{ type: 'Program',
  body:
   [ { type: 'VariableDeclaration',
       declarations: [Object],
       kind: 'const' } ],
  sourceType: 'script' }

For more information, please read the complete documentation.

Current Tags

  • 4.0.1-27                                ...           latest (7 years ago)

21 Versions

  • 4.0.1-27                                ...           7 years ago
  • 4.0.1-26                                ...           7 years ago
  • 4.0.1-25                                ...           7 years ago
  • 4.0.1-24                                ...           8 years ago
  • 4.0.1-23                                ...           8 years ago
  • 4.0.1-22                                ...           8 years ago
  • 4.0.1-21                                ...           8 years ago
  • 4.0.1-19                                ...           8 years ago
  • 4.0.1-17                                ...           8 years ago
  • 4.0.1-15                                ...           8 years ago
  • 4.0.1-13                                ...           8 years ago
  • 4.0.1-12                                ...           8 years ago
  • 4.0.1-10                                ...           8 years ago
  • 4.0.1-9                                ...           8 years ago
  • 4.0.1-8                                ...           8 years ago
  • 4.0.1-6                                ...           8 years ago
  • 4.0.1-5                                ...           8 years ago
  • 4.0.1-4                                ...           8 years ago
  • 4.0.1-3                                ...           8 years ago
  • 4.0.1-2                                ...           8 years ago
  • 4.0.1-1                                ...           8 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |