# esprima-next

> ECMAScript parsing infrastructure for multipurpose analysis

Latest version **6.0.3** (published 2024-03-13) · BSD-2-Clause license · 0 weekly downloads

## Install

```sh
npm install esprima-next
pnpm add esprima-next
yarn add esprima-next
bun add esprima-next
```

Provides the commands `esparse`, `esvalidate`.

## Health

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

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 6.0.3 |
| Published | 2024-03-13 |
| First published | 2021-06-15 |
| Weekly downloads | 0 |
| License | BSD-2-Clause |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=12 |
| Dependencies | 0 |
| Unpacked size | 644.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 21 |
| Author | Ariya Hidayat |
| Maintainers | jogibear9988 |
| Keywords | ast, ecmascript, esprima, javascript, parser, syntax |

## Links

- npm: https://www.npmjs.com/package/esprima-next
- Repository: https://github.com/node-projects/esprima-next
- Homepage: https://github.com/node-projects/esprima-next/
- Issues: https://github.com/node-projects/esprima-next/issues
- npm.io page: https://npm.io/package/esprima-next

## 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

- 6.0.3 (latest) — 2024-03-13
- 6.0.2 — 2024-01-06
- 6.0.1 — 2024-01-01
- 6.0.0 — 2023-12-28
- 5.8.4 — 2022-09-07
- 5.8.3 — 2022-06-06
- 5.8.2 — 2022-05-05
- 5.8.1 — 2022-01-03
- 5.8.0 — 2022-01-02
- 5.7.0 — 2021-10-03
- 5.6.3 — 2021-07-14
- 5.6.2 — 2021-07-14
- 5.6.1 — 2021-07-13
- 5.6.0 — 2021-07-13
- 5.5.0 — 2021-07-13
- … 9 more at https://npm.io/package/esprima-next/versions

## README

[![NPM version](https://img.shields.io/npm/v/esprima-next.svg)](https://www.npmjs.com/package/esprima-next)
[![npm download](https://img.shields.io/npm/dm/esprima-next.svg)](https://www.npmjs.com/package/esprima-next)
[![Tests](https://github.com/node-projects/esprima-next/workflows/Tests/badge.svg)](https://github.com/node-projects/esprima-next/actions)

Todo: Coverage does not work atm.
[![Coverage Status](https://img.shields.io/codecov/c/github/node-projects/esprima-next/master.svg)](https://codecov.io/github/node-projects/esprima-next)

**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/node-projects/esprima-next/contributors).

### esprima-next

A fork of esprima (https://github.com/jquery/esprima), cause esprima has no new releases and many not merged pull req.
if development/maintenance at jquery will start again, we maybe remove this fork.

### Changes to original Esprima:

- Rename to esprima-next
- generate a ESM build
- update npm packages
- disable npm run static-analysis && npm run dynamic-analysis, seem not to work after package update
- we don't need to support node <= 12
- ES2022 Class Properties & Privates
- Support numeric seperator and BigInt
- import assertions

following Pull reqs are merged from @esprima github:

- Export Esrpima Nodes type #2045
- Fix super() in non derived class #2047
- Support for ES2020 import.meta #2052
- Support for ES2020 export ns from #2055
- Fix parsing error in exponent expressions with unary left-hand sides. #2070
- bugfix import() #2076
- Support ES2021 Logical Assignment #2082
- ESM release support #2081

### Features

- Full support for ECMAScript 2022 ([ECMA-262 13th 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) (~1600 [unit tests](https://github.com/jquery/esprima/tree/master/test/fixtures) with [full code coverage](https://codecov.io/github/jquery/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
> import { esprima } from 'esprima-next';
> 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](http://esprima.org/doc).

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