# dsherret/ts-morph

TypeScript Compiler API wrapper for static analysis and programmatic code changes.

Repository: https://github.com/dsherret/ts-morph
Canonical: https://ross.abutalabs.com/products/ts-morph
Homepage: https://ts-morph.com
Language: TypeScript
License: MIT
License Family: permissive
Topics: typescript, ast, code-generation, javascript, static-analysis
Last push: 2026-08-26T13:47:14+00:00

## Health v2 (maintenance only)
Score: 88/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 99, release rhythm 67, longevity 100
- inputs: {"age_days": 3469, "days_push": 7, "days_rel": 143, "gap_med": 85, "n_releases_24m": 8}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 6164, forks 237 (observed 2026-08-28T04:09:36.786777+00:00)

## What it is
ts-morph is a TypeScript library that wraps the TypeScript Compiler API to simplify programmatic navigation and manipulation of TypeScript and JavaScript code. It provides an easier interface for static analysis, AST traversal, and automated code changes.

## Use cases
- write codemods that refactor TypeScript code automatically
- analyze TypeScript source files and query the AST
- generate TypeScript code programmatically
- build custom linters or static analysis tools
- rename or move symbols across a codebase
- extract type information from source files

## When to choose
- you need to programmatically edit or generate TypeScript/JavaScript code
- the raw TypeScript Compiler API feels too low-level and verbose
- you're building code analysis, refactoring, or migration tooling

## When to avoid
- you only need to transpile or type-check code without AST manipulation
- you're working with languages other than TypeScript/JavaScript
- you need runtime code instrumentation rather than static analysis

## Facets
- artifact type: library
- maturity: active
- function: parser, developer-tools, code-review
- domain: developer-tools, parsers, programming-languages
- platform: cross-platform
- tags: typescript-compiler-api, ast-manipulation, code-generation, static-analysis, codemod, nodejs, deno

## Member repositories
- dsherret/ts-morph (main) score 88

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:09:36.786777+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-29T17:47:28.146083+00:00, confidence not recorded.
  - readme: https://github.com/dsherret/ts-morph (fetched 2026-08-28T04:09:36.786777+00:00, sha 2a1ffaa93621)
  - homepage: https://ts-morph.com (fetched 2026-08-29T08:44:31.496655+00:00, sha 25d321f9a66c)
- Data as of 2026-08-30T08:39:29.467469+00:00.
