Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Generated on May 4, 2024 via pnpm

esprima 4.0.1

ECMAScript parsing infrastructure for multipurpose analysis
Package summary
Share
0
issues
1
license
1
BSD-2-Clause
Package created
25 Nov 2011
Version published
13 Jul 2018
Maintainers
1
Total deps
1
Direct deps
0
License
BSD-2-Clause

Issues

0
This package has no issues

Licenses

BSD 2-Clause "Simplified" License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
place-warranty
Cannot
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
esprima@4.0.1
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

0
All Dependencies CSV
β“˜ This is a list of esprima 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities

Visualizations

Frequently Asked Questions

What does esprima do?

Esprima is a standard-compliant, high-performance ECMAScript parser written in ECMAScript itself, popularly known as JavaScript. Esprima provides an infrastructure that can deliver a multipurpose analysis of ECMAScript codes, ensuring full support for ECMAScript 2017. Feature-wise, Esprima offers tokenization through lexical analysis and parsing of a JavaScript program through syntactic analysis.

How do you use esprima?

Esprima is generally used through Node.js. To start with, you'll need to require esprima in your program before proceeding with the lexical analysis or syntactic analysis.

  1. For lexical analysis, here's an example of how you can tokenize your code using Esprima:
var esprima = require('esprima');
var program = 'const answer = 42';
esprima.tokenize(program);

This will return each element of the 'program' variable along with their types organized in an array of objects.

  1. For syntactic analysis, you can parse your code using Esprima as follows:
var esprima = require('esprima');
var program = 'const answer = 42';
esprima.parseScript(program);

This will return the parsed syntax tree of the 'program' variable.

Where are the esprima docs?

The complete documentation of esprima, which includes additional details about the usage and functionalities of Esprima, can be found at the esprima official website esprima.org/doc. You can also gain detailed insights about Esprima's implementation on their GitHub repository.