# @gerhobbelt/esprima

> ECMAScript parsing infrastructure for multipurpose analysis

Latest version **4.0.1-27** (published 2019-07-19) · BSD-2-Clause license · 0 weekly downloads

## Install

```sh
npm install @gerhobbelt/esprima
pnpm add @gerhobbelt/esprima
yarn add @gerhobbelt/esprima
bun add @gerhobbelt/esprima
```

Provides the commands `esparse`, `esvalidate`.

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 4.0.1-27 |
| Published | 2019-07-19 |
| First published | 2017-10-13 |
| Weekly downloads | 0 |
| License | BSD-2-Clause |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=4 |
| Dependencies | 0 |
| Unpacked size | 322.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Ariya Hidayat |
| Maintainers | gerhobbelt |
| Keywords | ast, ecmascript, esprima, javascript, parser, syntax |

## Links

- npm: https://www.npmjs.com/package/@gerhobbelt/esprima
- Repository: https://github.com/GerHobbelt/esprima
- Homepage: http://esprima.org
- Issues: https://github.com/GerHobbelt/esprima/issues
- npm.io page: https://npm.io/package/@gerhobbelt/esprima

## Alternatives

- [babylon](https://npm.io/package/babylon.md) — 5.1M weekly downloads
- [csscolorparser](https://npm.io/package/csscolorparser.md) — 3.7M weekly downloads
- [expr-eval-fork](https://npm.io/package/expr-eval-fork.md) — 1.5M weekly downloads
- [@leeoniya/ufuzzy](https://npm.io/package/@leeoniya/ufuzzy.md) — 247.7K weekly downloads
- [xml-parser](https://npm.io/package/xml-parser.md) — 78.4K weekly downloads

## Recent versions

- 4.0.1-27 (latest) — 2019-07-19
- 4.0.1-26 — 2019-07-18
- 4.0.1-25 — 2019-07-18
- 4.0.1-24 — 2018-05-23
- 4.0.1-23 — 2018-05-22
- 4.0.1-22 — 2018-05-10
- 4.0.1-21 — 2018-05-06
- 4.0.1-19 — 2018-02-13
- 4.0.1-17 — 2018-01-07
- 4.0.1-15 — 2017-12-22
- 4.0.1-13 — 2017-11-10
- 4.0.1-12 — 2017-11-10
- 4.0.1-10 — 2017-10-27
- 4.0.1-9 — 2017-10-27
- 4.0.1-8 — 2017-10-27
- … 6 more at https://npm.io/package/@gerhobbelt/esprima/versions

## README

[![NPM version](https://img.shields.io/npm/v/esprima.svg)](https://www.npmjs.com/package/@gerhobbelt/esprima)
[![npm download](https://img.shields.io/npm/dm/esprima.svg)](https://www.npmjs.com/package/@gerhobbelt/esprima)
[![Build Status](https://img.shields.io/travis/GerHobbelt/esprima/master.svg)](https://travis-ci.org/GerHobbelt/esprima)
[![Coverage Status](https://img.shields.io/codecov/c/github/GerHobbelt/esprima/master.svg)](https://codecov.io/github/GerHobbelt/esprima)

>
> # NOTE
>
> This fork/clone of `esprima` tracks the original closely, but adds support for 
> parsing [JISON](https://github.com/GerHobbelt/jison) action code blocks, which
> MAY contain JISON-specific identifiers in the JavaScript code, e.g. `$1`, `@1`,
> `#1` and `#ID#`.
>
 
**Esprima** ([esprima.org](http://esprima.org), BSD license) is a high performance,
standard-compliant [ECMAScript](http://www.ecma-international.org/publications/standards/Ecma-262.htm)
parser written in ECMAScript (also popularly known as
[JavaScript](https://en.wikipedia.org/wiki/JavaScript)).
Esprima is created and maintained by [Ariya Hidayat](https://twitter.com/ariyahidayat),
with the help of [many contributors](https://github.com/GerHobbelt/esprima/contributors).

### Features

- Full support for ECMAScript 2017 ([ECMA-262 8th Edition](http://www.ecma-international.org/publications/standards/Ecma-262.htm))
- Sensible [syntax tree format](https://github.com/estree/estree/blob/master/es5.md) as standardized by [ESTree project](https://github.com/estree/estree)
- Experimental support for [JSX](https://facebook.github.io/jsx/), a syntax extension for [React](https://facebook.github.io/react/)
- Optional tracking of syntax node location (index-based and line-column)
- [Heavily tested](http://esprima.org/test/ci.html) (~1500 [unit tests](https://github.com/GerHobbelt/esprima/tree/master/test/fixtures) with [full code coverage](https://codecov.io/github/GerHobbelt/esprima))

### API

Esprima can be used to perform [lexical analysis](https://en.wikipedia.org/wiki/Lexical_analysis) (tokenization) or [syntactic analysis](https://en.wikipedia.org/wiki/Parsing) (parsing) of a JavaScript program.

A simple example on Node.js REPL:

```javascript
> 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](http://esprima.org/doc).

---
_Source: https://npm.io/package/@gerhobbelt/esprima · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
