@xberg-io/tree-sitter-language-pack-wasm 0.0.1

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.
Files changed (2) hide show
  1. package/README.md +155 -0
  2. package/package.json +25 -0
package/README.md ADDED
@@ -0,0 +1,155 @@
1
+ <p align="center">
2
+ <picture>
3
+ <source media="(prefers-color-scheme: dark)" srcset="https://cdn.jsdelivr.net/gh/xberg-io/assets@v1/banner/readme-banner-dark.svg">
4
+ <img alt="Xberg" width="420" src="https://cdn.jsdelivr.net/gh/xberg-io/assets@v1/banner/readme-banner-light.svg">
5
+ </picture>
6
+ </p>
7
+
8
+ # WebAssembly
9
+
10
+ <div align="center" style="display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 20px 0">
11
+ <a href="https://github.com/xberg-io/alef">
12
+ <img src="https://img.shields.io/badge/Bindings-alef%20%D7%90-007ec6" alt="Bindings" />
13
+ </a>
14
+ <!-- Language Bindings -->
15
+ <a href="https://crates.io/crates/tree-sitter-language-pack">
16
+ <img src="https://img.shields.io/crates/v/tree-sitter-language-pack?label=Rust&color=007ec6" alt="Rust" />
17
+ </a>
18
+ <a href="https://pypi.org/project/tree-sitter-language-pack/">
19
+ <img src="https://img.shields.io/pypi/v/tree-sitter-language-pack?label=Python&color=007ec6" alt="Python" />
20
+ </a>
21
+ <a href="https://www.npmjs.com/package/@xberg-io/tree-sitter-language-pack">
22
+ <img
23
+ src="https://img.shields.io/npm/v/@xberg-io/tree-sitter-language-pack?label=Node.js&color=007ec6"
24
+ alt="Node.js"
25
+ />
26
+ </a>
27
+ <a href="https://www.npmjs.com/package/@xberg-io/tree-sitter-language-pack-wasm">
28
+ <img
29
+ src="https://img.shields.io/npm/v/@xberg-io/tree-sitter-language-pack-wasm?label=WASM&color=007ec6"
30
+ alt="WASM"
31
+ />
32
+ </a>
33
+ <a href="https://central.sonatype.com/artifact/io.xberg.treesitterlanguagepack/tree-sitter-language-pack">
34
+ <img
35
+ src="https://img.shields.io/maven-central/v/io.xberg.treesitterlanguagepack/tree-sitter-language-pack?label=Java&color=007ec6"
36
+ alt="Java"
37
+ />
38
+ </a>
39
+ <a href="https://pkg.go.dev/github.com/xberg-io/tree-sitter-language-pack/packages/go">
40
+ <img
41
+ src="https://img.shields.io/github/v/tag/xberg-io/tree-sitter-language-pack?label=Go&color=007ec6"
42
+ alt="Go"
43
+ />
44
+ </a>
45
+ <a href="https://www.nuget.org/packages/TreeSitterLanguagePack/">
46
+ <img src="https://img.shields.io/nuget/v/TreeSitterLanguagePack?label=C%23&color=007ec6" alt="C#" />
47
+ </a>
48
+ <a href="https://packagist.org/packages/xberg-io/tree-sitter-language-pack">
49
+ <img
50
+ src="https://img.shields.io/packagist/v/xberg-io/tree-sitter-language-pack?label=PHP&color=007ec6"
51
+ alt="PHP"
52
+ />
53
+ </a>
54
+ <a href="https://rubygems.org/gems/tree_sitter_language_pack">
55
+ <img src="https://img.shields.io/gem/v/tree_sitter_language_pack?label=Ruby&color=007ec6" alt="Ruby" />
56
+ </a>
57
+ <a href="https://hex.pm/packages/tree_sitter_language_pack">
58
+ <img src="https://img.shields.io/hexpm/v/tree_sitter_language_pack?label=Elixir&color=007ec6" alt="Elixir" />
59
+ </a>
60
+ <a href="https://pub.dev/packages/tree_sitter_language_pack">
61
+ <img src="https://img.shields.io/pub/v/tree_sitter_language_pack?label=Dart&color=007ec6" alt="Dart" />
62
+ </a>
63
+ <a href="https://central.sonatype.com/artifact/io.xberg.tslp.android/tree-sitter-language-pack-android">
64
+ <img
65
+ src="https://img.shields.io/maven-central/v/io.xberg.tslp.android/tree-sitter-language-pack-android?label=Kotlin&color=007ec6"
66
+ alt="Kotlin"
67
+ />
68
+ </a>
69
+ <a href="https://github.com/xberg-io/tree-sitter-language-pack/tree/main/packages/swift">
70
+ <img src="https://img.shields.io/badge/Swift-SPM-007ec6" alt="Swift" />
71
+ </a>
72
+ <a href="https://github.com/xberg-io/tree-sitter-language-pack/tree/main/packages/zig">
73
+ <img src="https://img.shields.io/badge/Zig-package-007ec6" alt="Zig" />
74
+ </a>
75
+ <a href="https://github.com/xberg-io/tree-sitter-language-pack/releases">
76
+ <img src="https://img.shields.io/badge/C-FFI-007ec6" alt="C FFI" />
77
+ </a>
78
+
79
+ <!-- Project Info -->
80
+ <a href="https://github.com/xberg-io/tree-sitter-language-pack/blob/main/LICENSE">
81
+ <img src="https://img.shields.io/badge/License-MIT-007ec6" alt="License" />
82
+ </a>
83
+ <a href="https://docs.tree-sitter-language-pack.xberg.io">
84
+ <img src="https://img.shields.io/badge/Docs-tree--sitter--language--pack-007ec6" alt="Documentation" />
85
+ </a>
86
+ </div>
87
+
88
+ <div align="center" style="display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin: 28px 0 24px">
89
+ <a href="https://discord.gg/xt9WY3GnKR">
90
+ <img
91
+ height="22"
92
+ src="https://img.shields.io/badge/Discord-Chat-007ec6?logo=discord&logoColor=white"
93
+ alt="Join Discord"
94
+ />
95
+ </a>
96
+ </div>
97
+
98
+ Pre-compiled tree-sitter grammars in a WebAssembly bundle for browsers, Deno, and edge runtimes.
99
+
100
+ ## What This Package Provides
101
+
102
+ - **Parser access** — load a tree-sitter language parser by name without wiring individual grammar crates or packages.
103
+ - **Code intelligence primitives** — parse trees, functions, classes, imports, exports, symbols, docstrings, diagnostics, and syntax-aware chunks.
104
+ - **Shared cache model** — parsers are fetched and cached once, then reused by every call in the process.
105
+ - **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.
106
+ - **WASM package** — browser and edge-compatible parser bundle.
107
+
108
+ ## Installation
109
+
110
+ ```bash
111
+ npm install @xberg-io/tree-sitter-language-pack-wasm
112
+ ```
113
+
114
+ ## Quick Start
115
+
116
+ ```typescript
117
+ import init, { getParser } from "@xberg-io/tree-sitter-language-pack-wasm";
118
+
119
+ await init();
120
+ const parser = getParser("python");
121
+ const tree = parser.parse("def hello(): pass");
122
+ ```
123
+
124
+ ## Features
125
+
126
+ - **300+ languages** — pre-compiled tree-sitter grammars covering every major programming language and many minor ones.
127
+ - **On-demand download + cache** — parsers fetched at first use; subsequent runs hit the local cache.
128
+ - **Code intelligence** — extract functions, classes, imports, exports, symbols, docstrings, and diagnostics with one API.
129
+ - **Syntax-aware chunking** — semantic chunks for RAG/LLM pipelines.
130
+ - **Polyglot bindings** — native APIs across 15 languages: Rust, Python, TypeScript/Node.js, Go, Java, C#, Ruby, PHP, Elixir, WebAssembly, Dart, Kotlin, Swift, Zig, and C/C++ via [alef](https://github.com/xberg-io/alef).
131
+
132
+ ## Documentation
133
+
134
+ - **[Documentation](https://docs.tree-sitter-language-pack.xberg.io)** -- Full docs and API reference
135
+ - **[GitHub Repository](https://github.com/xberg-io/tree-sitter-language-pack)** -- Source, issues, and discussions
136
+
137
+ ## Part of Xberg
138
+
139
+ - [Xberg](https://github.com/xberg-io/xberg) — document intelligence: text, tables, metadata from 91+ formats with optional OCR.
140
+ - [Xberg Enterprise](https://github.com/xberg-io/xberg-enterprise) — managed extraction API with SDKs, dashboards, and observability.
141
+ - [crawlberg](https://github.com/xberg-io/crawlberg) — web crawling and scraping with HTML→Markdown and headless-Chrome fallback.
142
+ - [html-to-markdown](https://github.com/xberg-io/html-to-markdown) — fast, lossless HTML→Markdown engine.
143
+ - [liter-llm](https://github.com/xberg-io/liter-llm) — universal LLM API client with native bindings for 14 languages and 143 providers.
144
+ - [alef](https://github.com/xberg-io/alef) — the polyglot binding generator that produces this README and all per-language bindings.
145
+ - [Discord](https://discord.gg/xt9WY3GnKR) — community, roadmap, announcements.
146
+
147
+ ## Contributing
148
+
149
+ Contributions are welcome! See [CONTRIBUTING.md](https://github.com/xberg-io/tree-sitter-language-pack/blob/main/CONTRIBUTING.md) for guidelines.
150
+
151
+ Join our [Discord community](https://discord.gg/xt9WY3GnKR) for questions and discussion.
152
+
153
+ ## License
154
+
155
+ MIT -- see [LICENSE](https://github.com/xberg-io/tree-sitter-language-pack/blob/main/LICENSE) for details.
package/package.json ADDED
@@ -0,0 +1,25 @@
1
+ {
2
+ "name": "@xberg-io/tree-sitter-language-pack-wasm",
3
+ "version": "0.0.1",
4
+ "private": false,
5
+ "description": "Pre-compiled tree-sitter grammars for 306 programming languages",
6
+ "license": "MIT",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "https://github.com/xberg-io/tree-sitter-language-pack",
10
+ "directory": "crates/ts-pack-core-wasm"
11
+ },
12
+ "files": [
13
+ "pkg",
14
+ "*.wasm",
15
+ "*.d.ts",
16
+ "README.md"
17
+ ],
18
+ "type": "module",
19
+ "main": "pkg/nodejs/ts_pack_core_wasm.js",
20
+ "module": "pkg/web/ts_pack_core_wasm.js",
21
+ "types": "pkg/nodejs/ts_pack_core_wasm.d.ts",
22
+ "publishConfig": {
23
+ "access": "public"
24
+ }
25
+ }