Back to Explore

estools/esquery

GitHub
1 watchersOpen source

Last release: 7/8/2024

ESQuery is a JavaScript library for querying an Esprima-generated ECMAScript AST using a CSS-style selector syntax. It is useful for finding AST nodes that match patterns, such as node types, nested fields, and selector-based relationships like parent-child and sibling combinators.

Project status

  • The repository is plausibly actively maintained, with an upstream push dated 2025-12-31, and it has published tagged updates at least as recently as 2024-07-08 (v1.6.0).
  • Apparent update cadence looks relatively low and bursty, with tagged updates in 2024 (v1.6.0), 2023 (v1.5.0 and v1.4.2), suggesting roughly year-scale intervals between documented versioned updates.

AI summary generated Today

AI-generated from public sources. May be inaccurate. Report

Recent updates

  • v1.6.0

    7/8/2024

    v1.6.0 introduces improved support for the CSS :has pseudo selector. Specifically, it extends parsing and matching so selectors inside :has() can begin with combinators such as > (child), allowing expressions like :has(> Identifier[name="x"]).

    Features
  • v1.5.0

    3/2/2023

    v1.5.0 introduces new customization hooks for esquery selectors, notably support for using a different AST node type property via an ESQueryOptions.nodeTypeKey option. It also extends the CSS-like :class pseudo selector handling with a new ESQueryOptions.matchClass callback and changes the selector grammar to accept a broader set of class names.

    BreakingFeatures
  • v1.4.2

    2/16/2023

    Release v1.4.2 was published on 2023-02-16, but no release notes were provided by the publisher. As a result, there is no documented information here about new features, fixes, breaking changes, or dependency updates.

  • v1.4.1

    2/16/2023

    No release notes were provided for v1.4.1. The code diff shows a substantial internal refactor in esquery.js focused on selector matching (including new matcher caching), along with a CI workflow change to add Node 18 and remove Node 6 testing.

  • v1.4.0

    2/5/2021

    v1.4.0 ships with substantial internal changes but the publisher provided no release notes. The code diff shows new support for querying custom AST node types via configurable visitor keys and traversal fallback logic, and it also includes changes to the selector grammar related to attribute name parsing. Build and CI configuration were updated as well.

    BreakingFeatures
  • v1.3.1

    4/16/2020

    Release v1.3.1 does not include any publisher-provided release notes. The code diff shows no library source changes, only an npm package version bump and dependency version updates in package.json.

  • v1.3.0

    4/15/2020

    Release v1.3.0 refactors esquery's selector matching internals by introducing a new traversal API. It adds query.traverse(ast, selector, visitor) and rewires query.match(ast, selector) to use the new traversal mechanism, with a new test covering traversal behavior.

    Features
  • v1.2.1

    4/13/2020

    Release v1.2.1 has no publisher release notes. The code diff shows changes primarily to build and test tooling (Babel setup, Rollup config, CI matrix, and test execution wiring), plus small test behavior adjustments for older Node versions.

    Breaking
  • v1.2.0

    3/23/2020

    v1.2.0 includes a major modernization of the project toolchain and build output (rollup-based bundling into dist artifacts) plus changes to the selector grammar and runtime implementation. Release notes were not provided by the publisher, so the behavioral and packaging changes below are inferred directly from the code diff.

    Features
  • v1.1.0

    2/12/2020

    The release is tagged v1.1.0, but no release notes or change details were provided by the publisher. As a result, the information available here does not indicate any new features, fixes, breaking changes, or dependency updates for developers.