esquery

A query library for ECMAScript AST using a CSS selector like query language.

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:

demo

The following selectors are supported: