npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@gitkraken/tree-sitter-wasm

v0.1.1

Published

Tree-sitter grammars compiled to WASM for merge-mate validators

Downloads

241

Readme

@gitkraken/tree-sitter-wasm

Tree-sitter grammars compiled to WASM, with multiple versions of a grammar shipped side by side where a language's syntax has drifted across editions.

Why this exists

Off-the-shelf grammar bundles (tree-sitter-wasms, @vscode/tree-sitter-wasm) ship a single grammar version per language, and no single version parses both the legacy and modern syntax of an evolving language. Building the grammars here lets us ship multiple versions of the same grammar and pin everything against a known ABI.

Rust is the clearest case. Measured on a 1059-file corpus of valid Rust (false positive = grammar reports an error on valid code):

| grammar | false positives | |---|---| | old only (try!-friendly) | 1.8% | | latest only | 3.3% (rejects pre-2018 try!) | | newest → oldest | 0.0% |

try! (removed when try became reserved in edition 2018) only parses on the old grammar; let-else (1.65) only on the new one. Shipping both and trying newest-first, oldest-as-fallback covers the union.

ABI

Grammars build at ABI 14/15 (current tree-sitter-cli). Both load under [email protected] and 0.26.x (verified). 0.26 raised the ABI floor, but that only orphans third-party ABI-13 wasm built with tree-sitter-cli 0.20.x; grammars built here are ABI 14/15, so they load on the latest runtime. 0.26 also renamed the engine wasm asset to web-tree-sitter/web-tree-sitter.wasm (was tree-sitter.wasm).

Install

Published to public npm (private source repo, public artifact). No registry config or auth needed.

pnpm add @gitkraken/tree-sitter-wasm

The tarball ships the compiled out/*.wasm plus out/manifest.json. Releases publish on a v* tag via .github/workflows/publish.yml (uses the NPM_TOKEN_GITKRAKEN org secret).

Build

pnpm install
pnpm build      # clones each grammar at its pinned ref, compiles to out/*.wasm
pnpm test       # contract test: files load, ABI in range, edition invariants hold

Outputs out/tree-sitter-<lang>.wasm (single version) or out/tree-sitter-<lang>.<label>.wasm (multi-version), plus out/manifest.json recording ref + resolved SHA per grammar.

Toolchain: tree-sitter build --wasm auto-downloads wasi-sdk. No manual emscripten setup.

Grammars

Configured in grammars.json. A language with edition/version syntax drift (currently Rust) ships latest + legacy; a consumer parses with the newest and falls back to older versions.

Multi-version only helps when the false positives come from edition drift. For C, C++ and C# the dominant cause is instead the C preprocessor / conditional compilation (#if, #region), which a context-free grammar cannot resolve: measured ~50%+ on C/C++ and 6.73% on C# (60% of it preprocessor-driven). That is intrinsic to parsing those languages with tree-sitter, not grammar age, so no combination of versions fixes it. Those grammars ship a single version.