</>PackageGraphPackageGraph

esprima

npmv4.0.1

ECMAScript parsing infrastructure for multipurpose analysis

Not recommended for new projects

No — esprima should not be adopted for new projects. Last published 2980 days ago.

  • AAdoption: grade A, Excellent.

    77.6M downloads per week and 5 known dependents.

  • FMaintenance: grade F, Failing.

    Last published 2980 days ago.

  • AWeight: grade A, Excellent.

    Zero runtime dependencies, about 307 KB installed.

  • BSupply chain: grade B, Good.

    This package has a single maintainer (bus factor of 1).

  • ALicense: grade A, Excellent.

    BSD-2-Clause — permissive, with no copyleft found in the dependency tree.

Grades are computed deterministically from registry metadata collected by PackageGraph — downloads, dependents, publish dates, the resolved dependency tree, maintainer count, and declared licenses. No third-party scores are used.

Install cost

What you actually take on by adding esprima to a project.

0
Direct dependencies

Runtime packages this one declares itself.

0
Total installed

Distinct packages in the full runtime tree, deduplicated the way a package manager would.

307 KB
Install size

Unpacked size of this package plus its entire runtime tree.

Tree depth

Longest resolved dependency chain below this package.

Compatibility

Node.js
node >=4
Module format
CommonJS only
TypeScript
No bundled types
Install scripts
None

Quick start

A usage example from the esprima README.

javascriptFull README ↗
> 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],
Example truncated — see the full README.

esprima vs the alternatives

Packages solving a similar problem in the npm ecosystem, compared on the signals that drive an adoption decision.

PackageWeekly downloadsDependentsLicenseLast release
esprimathis page77.6M5BSD-2-Clause8 years ago
espree04BSD-2-Clause1 day ago
eslint138.4M279MIT1 day ago
esquery01BSD-3-Clause1 day ago
@babel/parser023MIT1 day ago
@webassemblyjs/wasm-parser05MIT1 day ago

Dependencies

Declared by esprima v4.0.1. Runtime dependencies are installed with the package; dev dependencies are not.

Dev (26)

codecov.io ~0.1.6escomplex-js 1.2.0everything.js ~1.0.3glob ~7.1.0istanbul ~0.4.0json-diff ~0.3.1karma ~1.3.0karma-chrome-launcher ~2.0.0karma-detect-browsers ~2.2.3karma-edge-launcher ~0.2.0karma-firefox-launcher ~1.0.0karma-ie-launcher ~1.0.0karma-mocha ~1.3.0karma-safari-launcher ~1.0.0karma-safaritechpreview-launcher ~0.0.4karma-sauce-launcher ~1.1.0lodash ~3.10.1mocha ~3.2.0node-tick-processor ~0.0.2regenerate ~1.3.2temp ~0.8.3tslint ~5.1.0typescript ~2.3.2typescript-formatter ~5.1.3unicode-8.0.0 ~0.7.0webpack ~1.14.0

Used by

Popular packages that depend on esprima.

Relationship graph

Dependencies (left) and dependents (right) of esprima.

Frequently installed together

Release history

No releases in the last two years, typically about 31 days apart.

Recent versions of esprima
VersionPublishedSizeLicense
4.0.1latest8 years ago307 KBBSD-2-Clause
4.0.09 years agoBSD-2-Clause
3.1.39 years agoBSD-2-Clause
3.1.29 years agoBSD-2-Clause
3.1.110 years agoBSD-2-Clause
3.1.010 years agoBSD-2-Clause
3.0.010 years agoBSD-2-Clause
2.7.310 years agoBSD-2-Clause
2.7.210 years agoBSD-2-Clause
2.7.110 years agoBSD-2-Clause
2.7.011 years agoBSD-2-Clause
2.6.011 years agoBSD-2-Clause
2.5.011 years agoBSD-2-Clause
2.4.111 years agoBSD-2-Clause
2.4.011 years agoBSD-2-Clause

Overview

esprima is an npm package that eCMAScript parsing infrastructure for multipurpose analysis. It is extremely widely used, with about 77.6M downloads per week and 5 known dependents in the graph. The latest version is 4.0.1, released under the BSD-2-Clause license.

Who should use it

Teams working in the npm ecosystem who need eCMAScript parsing infrastructure for multipurpose analysis and value a battle-tested, widely-adopted solution.

When not to use it

Consider an alternative if you need to minimize your dependency tree, have first-class TypeScript types out of the box, or if a more actively-maintained option better fits your npm stack.

Pros

  • Large, well-established user base (77.6M weekly downloads).
  • Clear open-source license (BSD-2-Clause).

Cons

  • Large dependency tree (26 direct dependencies) increases install size and audit surface.
  • No bundled TypeScript types (may require a separate @types package).

Auto-generated from collected registry metadata. No external claims are inferred.

Maintainers

Keywords

Frequently asked questions

Should I use esprima?

No — esprima should not be adopted for new projects. Last published 2980 days ago.

How do I install esprima?

Run `npm install esprima` to add esprima to your npm project.

What license is esprima released under?

esprima is distributed under the BSD-2-Clause license.

How popular is esprima?

esprima has approximately 77,553,420 downloads per week and 5 known dependent packages.

Is esprima still maintained?

The most recent release of esprima (v4.0.1) was published 8 years ago.

Does esprima run install scripts?

No. esprima does not define preinstall, install, or postinstall scripts, so installing it does not execute publisher-supplied code.