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


ECMAScript AST query library.

475 Stars 63 Forks Other 119 Commits 26 Opened issues

Services available

Need anything else?

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.