# phenomnomnominal/tsquery

TypeScript AST query library

Repository: https://github.com/phenomnomnominal/tsquery
Canonical: https://ross.abutalabs.com/products/tsquery
Language: TypeScript
License: MIT
License Family: permissive
Last push: 2026-04-06T22:57:35+00:00

## Health v2 (maintenance only)
Score: 66/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 76, release rhythm 35, longevity 100
- inputs: {"age_days": 3056, "days_push": 149, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1053, forks 33 (observed 2026-08-28T04:03:23.879823+00:00)

## What it is
TSQuery is a TypeScript library that ports the ESQuery API to TypeScript, letting you query a TypeScript AST using CSS-style selectors. It supports node type selectors, attribute matching, combinators, and pseudo-classes for pattern-based syntax matching.

## Use cases
- find all identifiers named X in a TypeScript file
- query TypeScript AST with CSS-like selectors
- write custom lint rules that match syntax patterns
- search code for specific AST node patterns
- extract class declarations or function signatures from TypeScript source
- build codemods that select nodes to transform

## When to choose
- you need pattern-based searching over TypeScript source code
- you're building linting, refactoring, or codemod tooling on the TypeScript compiler API
- you already know ESQuery or CSS selectors and want the same ergonomics for TS ASTs

## When to avoid
- you need to query JavaScript or other languages' ASTs (use ESQuery or a language-specific tool)
- you need full TypeScript type information rather than syntax patterns
- you want a GUI-based code search tool

## Facets
- artifact type: library
- maturity: active
- function: parser, search-engine, developer-tools
- domain: developer-tools, parsers, programming-languages
- platform: cross-platform
- tags: ast, typescript-ast, css-selectors, code-analysis, esquery, static-analysis, code-search, nodejs, typescript

## Member repositories
- phenomnomnominal/tsquery (main) score 66

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:03:23.879823+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T06:59:22.996385+00:00, confidence not recorded.
  - readme: https://github.com/phenomnomnominal/tsquery (fetched 2026-08-28T04:03:23.879823+00:00, sha d19d05e6e1db)
- Data as of 2026-08-30T08:39:29.467469+00:00.
