tree-sitter-typescript
TypeScript and TSX grammars for tree-sitter
What it is and what it does
tree-sitter-typescript is a grammar module that plugs into the tree-sitter incremental parser framework, providing language definitions for TypeScript and TSX (TypeScript with JSX). It lets you parse TypeScript and TSX source code into syntax trees that can be queried and analyzed programmatically. The package ships as precompiled binaries for major platforms, reducing setup friction.
You use this when you need to analyze, transform, or lint TypeScript code at the syntax level—building developer tools, linters, code generators, or IDE features. It's part of the tree-sitter ecosystem, which emphasizes speed and incremental updates; the grammar itself is maintained by the tree-sitter project and tracks the TypeScript language spec.
Use it for:
- Build a TypeScript linter or code analyzer that needs to walk the syntax tree.
- Generate code transformations or refactoring tools for TypeScript projects.
- Implement IDE features like symbol navigation or syntax highlighting for TypeScript.
- Parse and analyze TypeScript codebases for metrics, complexity, or dependency extraction.
- Create a code formatter or pretty-printer for TypeScript and TSX.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides TypeScript and TSX language grammars for tree-sitter, enabling incremental parsing and syntax tree generation for TypeScript and JSX code.
Yes, if you are building tools that need to parse TypeScript or TSX and you are already using tree-sitter. The package is well-maintained within the tree-sitter ecosystem, has no known vulnerabilities, and provides prebuilt binaries for common platforms. Install friction is moderate but manageable. Not necessary if you only need basic TypeScript parsing or are using a different parsing framework.
Install
tree-sitter-typescript on PyPI
pip
pip install tree-sitter-typescriptuv
uv add tree-sitter-typescriptpoetry
poetry add tree-sitter-typescriptInstalling tree-sitter-typescript
Before you install
Medium install friction due to compiled binary wheels; prebuilt wheels available for common platforms (macOS x86_64/arm64, Linux x86_64/aarch64, Windows). Last release was 641 days ago; repository is active but aging.
License in practice
MIT license is permissive; you can use, modify, and distribute this package freely with minimal restrictions.
Quickstart
pip install tree-sitter-typescript
from tree_sitter_typescript import get_language
lang = get_language('typescript')
# or for TSX: lang = get_language('tsx')
Requires Python >=3.9 and a tree-sitter parser instance to work with; this package provides only the grammar, not the parser itself.
Verify before relying
- Whether tree-sitter core library is a runtime dependency (not listed in friction evidence but likely required to use the grammar).
- Performance characteristics for large codebases or real-time parsing scenarios.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | none |
| Maintenance | aging — 641 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 7,804,794/month — #1,692 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: tree_sitter_typescript-0.23.2-cp39-abi3-macosx_10_9_x86_64.whl; tree_sitter_typescript-0.23.2-cp39-abi3-macosx_11_0_arm64.whl; tree_sitter_typescript-0.23.2-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; tree_sitter_typescript-0.23.2-cp39-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl; tree_sitter_typescript-0.23.2-cp39-abi3-musllinux_1_2_x86_64.whl; tree_sitter_typescript-0.23.2-cp39-abi3-win_amd64.whl; tree_sitter_typescript-0.23.2-cp39-abi3-win_arm64.whl
Keywords: incremental, parsing, tree-sitter, typescript, tsx
Tags
More Linguistic packages
Detects and normalizes text encoding from…
permissive · top 100 on PyPI
tiktokentiktoken is a fast BPE tokenizer that converts…
permissive · top 1,000 on PyPI
chardetDetects character encoding and language in byte…
permissive · top 1,000 on PyPI
text-unidecodeConverts Unicode text to ASCII by…
copyleft · top 1,000 on PyPI
larkLark is a parsing library that builds abstract…
permissive · top 1,000 on PyPI
tree-sitterPython bindings to the tree-sitter parsing…
permissive · top 1,000 on PyPI
tree-sitter-javaProvides a Java language grammar for…
permissive · top 5,000 on PyPI
tree-sitter-javascriptProvides a JavaScript and JSX parser grammar…
permissive · top 5,000 on PyPI
tree-sitter-goProvides a Go language grammar for tree-sitter,…
permissive · top 5,000 on PyPI
tree-sitter-pythonProvides a Python grammar for tree-sitter,…
permissive · top 5,000 on PyPI
tree-sitter-jsonProvides a JSON grammar parser for tree-sitter,…
permissive · top 5,000 on PyPI
tree-sitter-kotlinProvides a Kotlin language grammar for…
permissive · top 5,000 on PyPI
tree-sitter-haskellProvides a tree-sitter parser grammar for…
permissive · top 15,000 on PyPI
esprima2Parses and tokenizes JavaScript code up to ECMA…
permissive · top 15,000 on PyPI
lark-parserLark is a parsing library that builds abstract…
permissive · top 5,000 on PyPI