# Esprima: 2.4 out of 10

Do not start with it. 9th of 9 in [JavaScript parsers and codemods](https://elestia.ai/opensource/parsers/index.md).

Esprima is a pioneering ECMAScript parser, but it is effectively abandoned. The last release was 4.0.1 in July 2018, it stops at ES2017, and an OpenJS proposal to archive it has been open since 2024. Its very large download count comes from old transitive installs, mostly js-yaml 3.x. For new work, pick Acorn, Babel parser, Oxc or Meriyah.

**Best for:** Only legacy codebases that already depend on it and parse code no newer than ES2017.

## Scores

- **Overall: 2.4** (likely 1.5 to 3.5)
  - Claude Opus 5.5 (1.5): Esprima is unmaintained and cannot parse syntax from 2018 onwards, so it fails on much of today's JavaScript. Acorn, Babel parser, Oxc and Meriyah all do the same job better and are active. Keep it only where it is pulled in transitively, and start new work with a maintained parser.
  - GPT-6.2 Sol (3.3): Esprima remains serviceable when an existing tool expects its exact AST and the input stays within ES2017. For new work, Acorn covers modern JavaScript with ESTree output, and Babel parser handles TypeScript and JSX. The years without a release and the confirmed syntax gaps make those peers stronger choices, though strict compatibility with an older tool can still justify Esprima.
- **Needed by many: 3.1** (likely 2.0 to 4.2)
  - Claude Opus 5.5 (3.0): Parsing JavaScript into a tree is a tooling niche, and Esprima covers only its JavaScript half. It cannot handle TypeScript or modern syntax, so it fits fewer projects than its category does.
  - GPT-6.2 Sol (3.1): Parsers underpin linters and build tools, and developers usually choose one directly when writing tooling or codemods. Esprima’s ES2017 ceiling narrows that group further, especially given how much TypeScript respondents use in the 2025 State of JavaScript survey. The survey does not measure how many teams still need to parse older JavaScript.
- **Helps a lot: 3.0** (likely 2.1 to 4.2)
  - Claude Opus 5.5 (2.0): The stable 4.0.1 release stops at ES2017. It fails on optional chaining, class fields, static properties, BigInt and dynamic import, which are common in today's code. It has no TypeScript types. Every peer parses modern code that Esprima rejects.
  - GPT-6.2 Sol (4.0): Esprima has a simple, documented ESTree API with source locations and limited error recovery. Version 4.0.1 rejects optional chaining and object spread, lacks TypeScript parsing, and relies on community declarations for typed calls. A small independent benchmark found it competitive with Acorn on older inputs and slower than Meriyah. The score varies most with how tightly a team can control its input syntax.
- **Holds up over time: 1.2** (likely 0.5 to 2.2)
  - Claude Opus 5.5 (0.5): There have been no commits since April 2023, no release since 2018, and no commits or releases in the last year. The OpenJS Foundation proposed archiving it because it could not reach the maintainers, and an 'Is this project abandoned?' issue is open. The ecosystem has moved to Acorn/Espree, Babel and Oxc.
  - GPT-6.2 Sol (1.8): The last npm publish was in July 2018, and the bundle records zero commits or releases in the past year. A request for optional chaining has been open since 2022, while Acorn and Babel parser both shipped updates in 2026. OpenJS hosting and the stable API give existing users some continuity, but the pace of maintenance makes a catch-up release unlikely.
- **Used widely: 5.2** (likely 3.6 to 6.7)
  - Claude Opus 5.5 (4.0): About 608M downloads in 4 weeks and 1.5M dependent repos look huge, but almost all of it is transitive, mainly from js-yaml 3.x through older test and build tooling. The yearly ratio of about 2.26 is well below the 4.1 median, so it is losing ground. There is no social attention (0 Bluesky posts, 0 Hacker News stories), and few people choose it directly today.
  - GPT-6.2 Sol (6.3): The bundle records about 1.54 million dependent repositories, ahead of Acorn and behind Babel parser. Recast and Escodegen install Esprima automatically, and build servers repeat installs, so the number of projects that chose it directly is hard to estimate. Downloads reached 608 million in four weeks, up 2.26 times year over year. That trails the catalog median of 4.1 times, Acorn, and Babel parser, indicating a loss of relative ground.
- **Vouched for: 3.4** (likely 2.2 to 4.8)
  - Claude Opus 5.5 (2.0): In the past it was the reference ESTree parser, and ESLint and Istanbul built on it. Those projects have since moved away. No current survey, framework or company points to it as a choice today.
  - GPT-6.2 Sol (4.8): Recast still selects Esprima as its default parser, and an independent benchmark found its speed competitive on older JavaScript. ESLint reports that it moved away after falling behind on language features and now builds its parser on Acorn. Recent evidence of teams choosing Esprima for modern projects is scarce, which keeps the range wide.
- **Safe: 5.5** (likely 4.1 to 7.0)
  - Claude Opus 5.5 (5.0): It has no advisories, no dependencies and a permissive BSD-2-Clause licence, so the attack surface is small. But the Scorecard is 3.9 with Maintained at 0, and nobody is responsive, so any future bug or vulnerability would stay unfixed. Its parse failures on modern code are also a reliability risk.
  - GPT-6.2 Sol (6.0): The package has zero runtime dependencies, a permissive BSD-2-Clause licence, and no advisories in OSV or Snyk. Its OpenSSF Scorecard is 3.9, with weak code review and zero scores for branch protection and fuzzing. OpenJS provides a disclosure route, but the package lists one maintainer and years without a release leave future patch response uncertain.

## Good

- It has no runtime dependencies and a permissive BSD-2-Clause licence.
- It produces the standard ESTree-style AST, with tokens, comments and location data.
- It has a long, clean security record with no known advisories.
- On ES2017 code it is still a fast, well-tested pure-JS parser.

## Bad

- It cannot parse optional chaining, class fields, BigInt, dynamic import or other ES2018+ syntax.
- There has been no release since 2018, no commits since 2023, and maintainers have not answered the foundation.
- It ships no TypeScript types and cannot parse TypeScript.
- Its downloads come almost entirely from old transitive installs such as js-yaml 3.x, not from new choices.

## The numbers

- Downloads, 4 weeks: 608M
- In a year: ×2.3
- GitHub stars: 7.1k
- Commits, 12 months: 0
- Last npm release: Jul 2018
- Advisories, 24 months: 0
- Licence: BSD-2-Clause
- GitHub: https://github.com/jquery/esprima
- npm: https://www.npmjs.com/package/esprima

Scores run from 0 to 10 and are the mean of the scores of AI reviewers (Claude Opus 5.5, GPT-6.2 Sol), made on 22 November 2026 from GitHub, npm, OSV, OpenSSF Scorecard, ecosyste.ms, Hacker News and Bluesky data and a web search. The ecosyste.ms count of repositories that use a project is far too low for projects that grew in the last few years, and some reviews quote it. Overall is the reviewers' own judgement for a new project today, not an average of the parts. An AI wrote them and can be wrong.
