Parse a JavaScript file to extract all function names and build a table of contents
Build a linter rule that flags a specific coding pattern across your codebase
Analyze a codebase to find unused variables by walking the syntax tree
Transform JavaScript source code by modifying the parsed tree and printing it back
| jquery/esprima | imgly/background-removal-js | bubkoo/html-to-image | |
|---|---|---|---|
| Stars | 7,137 | 7,136 | 7,134 |
| Language | TypeScript | TypeScript | TypeScript |
| Setup difficulty | easy | easy | easy |
| Complexity | 2/5 | 2/5 | 2/5 |
| Audience | developer | developer | developer |
Figures from each repo's GitHub metadata at analysis time.
Esprima is a JavaScript parser: a tool that reads JavaScript code and breaks it down into a structured representation that other programs can analyze. When you write JavaScript, it is just text. A parser turns that text into a tree of objects that describes the code's structure, showing which parts are variable declarations, which are function calls, which are loops, and so on. This tree format is called an abstract syntax tree. Developers use parsers like Esprima as a building block for tools that work with code programmatically. Linters that check code for style or errors, formatters that reformat code automatically, bundlers that combine files, and code analysis tools all typically rely on parsing JavaScript first. Esprima provides that foundation. The library supports JavaScript up to the ECMAScript 2019 standard, which is the version of JavaScript formalized that year. It also has experimental support for JSX, a syntax extension used in React applications that lets developers write HTML-like markup inside JavaScript. The output tree follows a standardized format maintained by the ESTree project, which means Esprima's output is compatible with many other tools that expect that format. Esprima is available as an npm package, so it can be installed with a standard JavaScript package manager and used in Node.js projects. It is maintained under the jQuery organization on GitHub and released under the BSD license, which permits free use in commercial and open-source projects. The README is brief, fuller documentation is available on the project's website.
Esprima parses JavaScript source code into a structured syntax tree (AST) that tools like linters, formatters, and code analyzers use to understand and transform code programmatically.
Mainly TypeScript. The stack also includes TypeScript, JavaScript, Node.js.
Use freely for any purpose, including commercial use, as long as you keep the copyright notice.
Setup difficulty is rated easy, with roughly 5min to a first successful run.
Mainly developer.
This repo across BitVibe Labs
Verify against the repo before relying on details.