# tree-sitter-typescript

> TypeScript and TSX grammars for tree-sitter

Latest version **0.23.2** (published 2024-11-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install tree-sitter-typescript
pnpm add tree-sitter-typescript
yarn add tree-sitter-typescript
bun add tree-sitter-typescript
```

## Health

**Score 50/100 (C)** — status: stable.

Positive: has types; no vulnerabilities; high maintenance score; high quality score.

Warnings: low downloads; no esm support; large bundle; pre 1.0.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 0.23.2 |
| Published | 2024-11-11 |
| First published | 2017-08-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 37 MB |
| Known vulnerabilities | 0 |
| Install scripts | yes |
| GitHub stars | 534 |
| Author | Max Brunsfeld |
| Maintainers | amaanq, ahlinc, maxbrunsfeld, tclem, daviwil, queerviolet, rewinfrey, ben3eee, atom-team, darangi, patrickthomson |
| Keywords | incremental, parsing, tree-sitter, typescript, tsx |

## Links

- npm: https://www.npmjs.com/package/tree-sitter-typescript
- Repository: https://github.com/tree-sitter/tree-sitter-typescript
- Homepage: https://github.com/tree-sitter/tree-sitter-typescript#readme
- Issues: https://github.com/tree-sitter/tree-sitter-typescript/issues
- npm.io page: https://npm.io/package/tree-sitter-typescript

## Dependencies (3)

- [node-addon-api](https://npm.io/package/node-addon-api.md) ^8.2.2
- [node-gyp-build](https://npm.io/package/node-gyp-build.md) ^4.8.2
- [tree-sitter-javascript](https://npm.io/package/tree-sitter-javascript.md) ^0.23.1

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 0.23.2 (latest) — 2024-11-11
- 0.23.1 — 2024-11-11
- 0.23.0 — 2024-09-02
- 0.21.2 — 2024-07-06
- 0.21.1 — 2024-05-06
- 0.20.5 — 2024-02-01
- 0.20.4 — 2024-01-31
- 0.20.3 — 2023-10-04
- 0.20.1 — 2022-03-29
- 0.19.0 — 2021-03-09
- 0.16.3 — 2021-02-05
- 0.16.1 — 2019-12-12
- 0.16.0 — 2019-12-10
- 0.15.2 — 2019-12-06
- 0.15.1 — 2019-06-19
- … 22 more at https://npm.io/package/tree-sitter-typescript/versions

## README

# tree-sitter-typescript

[![CI][ci]](https://github.com/tree-sitter/tree-sitter-typescript/actions/workflows/ci.yml)
[![discord][discord]](https://discord.gg/w7nTvsVJhm)
[![matrix][matrix]](https://matrix.to/#/#tree-sitter-chat:matrix.org)
[![crates][crates]](https://crates.io/crates/tree-sitter-typescript)
[![npm][npm]](https://www.npmjs.com/package/tree-sitter-typescript)
[![pypi][pypi]](https://pypi.org/project/tree-sitter-typescript)

TypeScript and TSX grammars for [tree-sitter][].

Because TSX and TypeScript are actually two different dialects, this module defines two grammars. Require them as follows:

```js
require("tree-sitter-typescript").typescript; // TypeScript grammar
require("tree-sitter-typescript").tsx; // TSX grammar
```

For Javascript files with [flow] type annotations you can use the `tsx` parser.

[tree-sitter]: https://github.com/tree-sitter/tree-sitter
[flow]: https://flow.org/en/

References

- [TypeScript Language Spec](https://github.com/microsoft/TypeScript/blob/main/doc/spec-ARCHIVED.md)

[ci]: https://img.shields.io/github/actions/workflow/status/tree-sitter/tree-sitter-typescript/ci.yml?logo=github&label=CI
[discord]: https://img.shields.io/discord/1063097320771698699?logo=discord&label=discord
[matrix]: https://img.shields.io/matrix/tree-sitter-chat%3Amatrix.org?logo=matrix&label=matrix
[npm]: https://img.shields.io/npm/v/tree-sitter-typescript?logo=npm
[crates]: https://img.shields.io/crates/v/tree-sitter-typescript?logo=rust
[pypi]: https://img.shields.io/pypi/v/tree-sitter-typescript?logo=pypi&logoColor=ffd242

---
_Source: https://npm.io/package/tree-sitter-typescript · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
