esprima
's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.Name | Version | Size | License | Type | Vulnerabilities |
---|
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.
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.
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.
var esprima = require('esprima');
var program = 'const answer = 42';
esprima.parseScript(program);
This will return the parsed syntax tree of the 'program' variable.
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.