Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Generated on May 16, 2024 via pnpm

esquery 1.5.0

A query library for ECMAScript AST using a CSS selector like query language.
Package summary
Share
0
issues
2
licenses
1
BSD-3-Clause
1
BSD-2-Clause
Package created
24 Jul 2013
Version published
2 Mar 2023
Maintainers
2
Total deps
2
Direct deps
1
License
BSD-3-Clause

Issues

0
This package has no issues

Licenses

BSD 3-Clause "New" or "Revised" 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
use-trademark
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
esquery@1.5.0

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:
estraverse@5.3.0
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

1
All Dependencies CSV
β“˜ This is a list of esquery 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
estraverse5.3.07.86 kBBSD-2-Clause
prod

Visualizations

Frequently Asked Questions

What does esquery do?

ESQuery is a powerful JavaScript library designed for querying the Abstract Syntax Tree (AST) generated by Esprima. Its functionality revolves around the use of a CSS-style selector system to recognize and identify patterns of syntax within the AST. It provides a highly flexible and efficient method for processing and analyzing JavaScript code, making it easier for developers to manipulate the structure and elements of scripts.

How do you use esquery?

Using ESQuery is straightforward and intuitive, especially for those familiar with CSS selectors. To implement it, you need to first establish the AST, then apply ESQuery functions. You can make use of a variety of selectors like AST node type, wildcard, attribute existence, attribute value, attribute regex, attribute conditions, nested attributes, and others for highly specific queries. Here's a basic example of utilizing ESQuery:

const esquery = require('esquery');
const esprima = require('esprima');

// Parse your JavaScript source code to AST using Esprima:
const ast = esprima.parseScript('your JavaScript code here');

// Use esquery to query specific patterns in the AST:
const matches = esquery.query(ast, 'your CSS style selector here');

In this example, 'matches' will hold an array of all the nodes in the AST that match the provided CSS style selector.

Where are the esquery docs?

You can find the ESQuery documentation and get detailed explanations on the different selectors and the syntax within the GitHub repository of the project. There's also a useful demo to see how the selectors work, providing a great way to experiment with the functionality of ESQuery and understanding how to use it effectively in your projects. Remember to check the selectors supported section, it exhibits comprehensive information on leveraging different selector types, including attribute value, descendant, child, and more.