Need help with esquery?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

559 Stars 75 Forks Other 123 Commits 31 Opened issues


ECMAScript AST query library.

Services available


Need anything else?

Contributors list

ESQuery is a library for querying the AST output by Esprima for patterns of syntax using a CSS style selector system. Check out the demo:


The following selectors are supported: * AST node type:

* wildcard:
* attribute existence:
* attribute value:
* attribute regex:
or (with flags)
* attribute conditions:
, or
* nested attribute:
* field:
FunctionDeclaration >
* First or last child:
* nth-child (no ax+b support):
* nth-last-child (no ax+b support):
* descendant:
ancestor descendant
* child:
parent > child
* following sibling:
node ~ sibling
* adjacent sibling:
node + adjacent
* negation:
* has:
* matches-any:
:matches([attr] > :first-child, :last-child)
* subject indicator:
!IfStatement > [name="foo"]
* class of AST node:
, or

Build Status

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.