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

@binclusive/tree-sitter-kotlin-wasm

v0.1.0

Published

The tree-sitter Kotlin grammar (@tree-sitter-grammars/tree-sitter-kotlin 1.1.0) vendored as a checksum-pinned wasm asset, resolvable by package name.

Readme

@binclusive/tree-sitter-kotlin-wasm

The tree-sitter Kotlin grammar vendored as a checksum-pinned .wasm asset, with zero runtime dependencies and no install script.

Upstream is on npm, and we depended on it directly until #3834. Doing so cost 45 MB installed and an install: node-gyp-build lifecycle script, to load one 3.3 MB file — the other 41 MB is generated C parser source, native .node bindings for six platforms we never open, and npm-check-updates, a developer tool declared as a runtime dependency. This package republishes only the wasm, unmodified. Full provenance, the reproduce command and the upgrade procedure are in PROVENANCE.md.

The sibling @binclusive/tree-sitter-swift-wasm is the same shape for Swift. Both grammars now reach a customer the same way — a first-party vendored-wasm package resolved by name — so the Kotlin/Swift difference is a dependency name rather than a second acquisition mechanism.

Install

Pin it exactly. The grammar version decides what the scanner can see, so it is a correctness input, not a compatible-upgrade axis (#3828, #3931):

pnpm add -E @binclusive/tree-sitter-kotlin-wasm

Use

import { readFile } from "node:fs/promises";
import { fileURLToPath } from "node:url";
import {
  KOTLIN_GRAMMAR,
  KOTLIN_GRAMMAR_WASM_SPECIFIER,
} from "@binclusive/tree-sitter-kotlin-wasm";
import { Language, Parser } from "web-tree-sitter";

const wasmPath = fileURLToPath(import.meta.resolve(KOTLIN_GRAMMAR_WASM_SPECIFIER));

// Verify before you parse: a wrong or truncated grammar under-parses SILENTLY, so it
// surfaces as missing findings rather than an error.
const bytes = await readFile(wasmPath);
const digest = Buffer.from(
  await crypto.subtle.digest("SHA-256", bytes),
).toString("hex");
if (digest !== KOTLIN_GRAMMAR.sha256) throw new Error("Kotlin grammar digest mismatch");

await Parser.init();
const parser = new Parser();
parser.setLanguage(await Language.load(bytes));

import.meta.resolve is the load-bearing detail: resolution runs through this package's exports map by name. A directory join off the consumer's import.meta.url is the exact mechanism behind #3120 — it resolves on the machine that built the image and nowhere else.

Identify the language from KOTLIN_GRAMMAR, not from the loaded module: this grammar is ABI 14, which predates grammar name metadata, so Language.name reads null.

Exports

| Specifier | What | | --- | --- | | @binclusive/tree-sitter-kotlin-wasm | KOTLIN_GRAMMAR (upstream repo, npm package, version, asset name, byte length, SHA-256, ABI, licence) and KOTLIN_GRAMMAR_WASM_SPECIFIER | | @binclusive/tree-sitter-kotlin-wasm/tree-sitter-kotlin.wasm | the grammar bytes |

The entry point is constants only — no node: imports, no runtime dependency — so it loads on Node, Workers and the browser alike.

Publishing

The workspace tests verify the committed bytes; verify:tarball verifies the artifact a customer actually receives. It packs, installs the tarball into a throwaway directory outside this repo with --ignore-scripts, resolves the wasm by package name from that install and parses Kotlin with it — so a broken files list, a publishConfig exports map or a newly-grown lifecycle script fails here rather than at a consumer:

pnpm -C packages/tree-sitter-kotlin-wasm run verify:tarball

(pnpm -C … run, never pnpm --filter … <script> — the latter exits 0 when the script is missing, #3839.)

Then publish the tarball (this workspace publishes packed tarballs rather than running pnpm publish in place):

cd packages/tree-sitter-kotlin-wasm
pnpm build
pnpm pack
npm publish --access public binclusive-tree-sitter-kotlin-wasm-<version>.tgz

Licence

The grammar is MIT, © 2024 Amaan Qureshi. The upstream notice ships verbatim in LICENSE and applies to the vendored wasm, which is the unmodified upstream artifact. This package adds no separately-licensed code.