@kreuzberg/tree-sitter-language-pack 1.8.1 → 1.9.0-rc.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,7 @@
1
+ Copyright 2025-2026 Na'aman Hirschfeld
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
+
5
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
+
7
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,185 @@
1
+ # TypeScript / Node.js
2
+
3
+ <div
4
+ align="center"
5
+ style="display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 20px 0"
6
+ >
7
+ <a href="https://github.com/kreuzberg-dev/alef">
8
+ <img src="https://img.shields.io/badge/Bindings-alef%20%D7%90-007ec6" alt="Bindings" />
9
+ </a>
10
+ <!-- Language Bindings -->
11
+ <a href="https://crates.io/crates/tree-sitter-language-pack">
12
+ <img
13
+ src="https://img.shields.io/crates/v/tree-sitter-language-pack?label=Rust&color=007ec6"
14
+ alt="Rust"
15
+ />
16
+ </a>
17
+ <a href="https://pypi.org/project/tree-sitter-language-pack/">
18
+ <img
19
+ src="https://img.shields.io/pypi/v/tree-sitter-language-pack?label=Python&color=007ec6"
20
+ alt="Python"
21
+ />
22
+ </a>
23
+ <a href="https://www.npmjs.com/package/@kreuzberg/tree-sitter-language-pack">
24
+ <img
25
+ src="https://img.shields.io/npm/v/@kreuzberg/tree-sitter-language-pack?label=Node.js&color=007ec6"
26
+ alt="Node.js"
27
+ />
28
+ </a>
29
+ <a href="https://www.npmjs.com/package/@kreuzberg/tree-sitter-language-pack-wasm">
30
+ <img
31
+ src="https://img.shields.io/npm/v/@kreuzberg/tree-sitter-language-pack-wasm?label=WASM&color=007ec6"
32
+ alt="WASM"
33
+ />
34
+ </a>
35
+ <a
36
+ href="https://central.sonatype.com/artifact/dev.kreuzberg.treesitterlanguagepack/tree-sitter-language-pack"
37
+ >
38
+ <img
39
+ src="https://img.shields.io/maven-central/v/dev.kreuzberg.treesitterlanguagepack/tree-sitter-language-pack?label=Java&color=007ec6"
40
+ alt="Java"
41
+ />
42
+ </a>
43
+ <a href="https://pkg.go.dev/github.com/kreuzberg-dev/tree-sitter-language-pack/packages/go">
44
+ <img
45
+ src="https://img.shields.io/github/v/tag/kreuzberg-dev/tree-sitter-language-pack?label=Go&color=007ec6"
46
+ alt="Go"
47
+ />
48
+ </a>
49
+ <a href="https://www.nuget.org/packages/TreeSitterLanguagePack/">
50
+ <img
51
+ src="https://img.shields.io/nuget/v/TreeSitterLanguagePack?label=C%23&color=007ec6"
52
+ alt="C#"
53
+ />
54
+ </a>
55
+ <a href="https://packagist.org/packages/kreuzberg/tree-sitter-language-pack">
56
+ <img
57
+ src="https://img.shields.io/packagist/v/kreuzberg/tree-sitter-language-pack?label=PHP&color=007ec6"
58
+ alt="PHP"
59
+ />
60
+ </a>
61
+ <a href="https://rubygems.org/gems/tree_sitter_language_pack">
62
+ <img
63
+ src="https://img.shields.io/gem/v/tree_sitter_language_pack?label=Ruby&color=007ec6"
64
+ alt="Ruby"
65
+ />
66
+ </a>
67
+ <a href="https://hex.pm/packages/tree_sitter_language_pack">
68
+ <img
69
+ src="https://img.shields.io/hexpm/v/tree_sitter_language_pack?label=Elixir&color=007ec6"
70
+ alt="Elixir"
71
+ />
72
+ </a>
73
+ <a href="https://pub.dev/packages/tree_sitter_language_pack">
74
+ <img
75
+ src="https://img.shields.io/pub/v/tree_sitter_language_pack?label=Dart&color=007ec6"
76
+ alt="Dart"
77
+ />
78
+ </a>
79
+ <a
80
+ href="https://central.sonatype.com/artifact/dev.kreuzberg.tslp.android/tree-sitter-language-pack-android"
81
+ >
82
+ <img
83
+ src="https://img.shields.io/maven-central/v/dev.kreuzberg.tslp.android/tree-sitter-language-pack-android?label=Kotlin&color=007ec6"
84
+ alt="Kotlin"
85
+ />
86
+ </a>
87
+ <a href="https://github.com/kreuzberg-dev/tree-sitter-language-pack/tree/main/packages/swift">
88
+ <img src="https://img.shields.io/badge/Swift-SPM-007ec6" alt="Swift" />
89
+ </a>
90
+ <a href="https://github.com/kreuzberg-dev/tree-sitter-language-pack/tree/main/packages/zig">
91
+ <img src="https://img.shields.io/badge/Zig-package-007ec6" alt="Zig" />
92
+ </a>
93
+ <a href="https://github.com/kreuzberg-dev/tree-sitter-language-pack/releases">
94
+ <img src="https://img.shields.io/badge/C-FFI-007ec6" alt="C FFI" />
95
+ </a>
96
+
97
+ <!-- Project Info -->
98
+ <a href="https://github.com/kreuzberg-dev/tree-sitter-language-pack/blob/main/LICENSE">
99
+ <img src="https://img.shields.io/badge/License-MIT-007ec6" alt="License" />
100
+ </a>
101
+ <a href="https://docs.tree-sitter-language-pack.kreuzberg.dev">
102
+ <img
103
+ src="https://img.shields.io/badge/Docs-tree--sitter--language--pack-007ec6"
104
+ alt="Documentation"
105
+ />
106
+ </a>
107
+ </div>
108
+
109
+ <div align="center" style="margin: 24px 0 0">
110
+ <a href="https://kreuzberg.dev">
111
+ <img alt="tree-sitter-language-pack" src="https:&#x2f;&#x2f;github.com&#x2f;user-attachments&#x2f;assets&#x2f;478a83da-237b-446b-b3a8-e564c13e00a8" />
112
+ </a>
113
+ </div>
114
+
115
+ <div
116
+ align="center"
117
+ style="display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin: 28px 0 24px"
118
+ >
119
+ <a href="https://discord.gg/xt9WY3GnKR">
120
+ <img
121
+ height="22"
122
+ src="https://img.shields.io/badge/Discord-Chat-007ec6?logo=discord&logoColor=white"
123
+ alt="Join Discord"
124
+ />
125
+ </a>
126
+ </div>
127
+
128
+ Pre-compiled tree-sitter grammars for 305 programming languages with TypeScript types.
129
+
130
+ ## What This Package Provides
131
+
132
+ - **Parser access** — load a tree-sitter language parser by name without wiring individual grammar crates or packages.
133
+ - **Code intelligence primitives** — parse trees, functions, classes, imports, exports, symbols, docstrings, diagnostics, and syntax-aware chunks.
134
+ - **Shared cache model** — parsers are fetched and cached once, then reused by every call in the process.
135
+ - **Same catalog as every binding** — Rust, Python, Node.js, Go, Java, PHP, Ruby, .NET, Elixir, WASM, Dart, Kotlin Android, Swift, Zig, and C FFI use the same grammar set.
136
+ - **Node-first TypeScript API** — native NAPI package with typed parser and query helpers.
137
+
138
+ ## Installation
139
+
140
+ ```bash
141
+ npm install @kreuzberg/tree-sitter-language-pack
142
+ ```
143
+
144
+ ## Quick Start
145
+
146
+ ```typescript
147
+ import { getParser } from "@kreuzberg/tree-sitter-language-pack";
148
+
149
+ const parser = getParser("python");
150
+ const tree = parser.parse("def hello(): pass");
151
+ console.log(tree.rootNode.toString());
152
+ ```
153
+
154
+ ## Features
155
+
156
+ - **300+ languages** — pre-compiled tree-sitter grammars covering every major programming language and many minor ones.
157
+ - **On-demand download + cache** — parsers fetched at first use; subsequent runs hit the local cache.
158
+ - **Code intelligence** — extract functions, classes, imports, exports, symbols, docstrings, and diagnostics with one API.
159
+ - **Syntax-aware chunking** — semantic chunks for RAG/LLM pipelines.
160
+ - **Polyglot bindings** — Rust core with native bindings for Python, TypeScript, Go, Java, C#, Ruby, PHP, Elixir, and WebAssembly via [alef](https://github.com/kreuzberg-dev/alef).
161
+
162
+ ## Documentation
163
+
164
+ - **[Documentation](https://docs.tree-sitter-language-pack.kreuzberg.dev)** -- Full docs and API reference
165
+ - **[GitHub Repository](https://github.com/kreuzberg-dev/tree-sitter-language-pack)** -- Source, issues, and discussions
166
+
167
+ ## Part of Kreuzberg.dev
168
+
169
+ - [Kreuzberg](https://github.com/kreuzberg-dev/kreuzberg) — document intelligence: text, tables, metadata from 90+ formats with optional OCR.
170
+ - [Kreuzberg Cloud](https://github.com/kreuzberg-dev/kreuzberg-cloud) — managed extraction API with SDKs, dashboards, and observability.
171
+ - [kreuzcrawl](https://github.com/kreuzberg-dev/kreuzcrawl) — web crawling and scraping with HTML→Markdown and headless-Chrome fallback.
172
+ - [html-to-markdown](https://github.com/kreuzberg-dev/html-to-markdown) — fast, lossless HTML→Markdown engine.
173
+ - [liter-llm](https://github.com/kreuzberg-dev/liter-llm) — universal LLM API client with native bindings for 14 languages and 143 providers.
174
+ - [alef](https://github.com/kreuzberg-dev/alef) — the polyglot binding generator that produces this README and all per-language bindings.
175
+ - [Discord](https://discord.gg/xt9WY3GnKR) — community, roadmap, announcements.
176
+
177
+ ## Contributing
178
+
179
+ Contributions are welcome! See [CONTRIBUTING.md](https://github.com/kreuzberg-dev/tree-sitter-language-pack/blob/main/CONTRIBUTING.md) for guidelines.
180
+
181
+ Join our [Discord community](https://discord.gg/xt9WY3GnKR) for questions and discussion.
182
+
183
+ ## License
184
+
185
+ MIT -- see [LICENSE](https://github.com/kreuzberg-dev/tree-sitter-language-pack/blob/main/LICENSE) for details.