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

chdb-cloudflare

v0.1.0

Published

chdb (ClickHouse) for Cloudflare Workers — a single size-capped WebAssembly bundle with a JSPI async-fetch HTTP bridge, so ClickHouse's url() and s3() table functions work inside Workers. Covers the most common SQL surface; for full SQL coverage use the c

Readme

chdb-cloudflare

chdb (ClickHouse) for Cloudflare Workers: one chdb.wasm under 10 MiB gzipped, sized to fit the Workers paid-plan bundle limit, with a JSPI async-fetch HTTP bridge so ClickHouse's url() and s3() table functions work inside Workers. Same SDK and API as chdb-wasm.

How it differs from chdb-wasm

The full chdb-wasm package ships the complete engine — every SQL feature works, but its wasm is ~100 MB (~21 MiB gzipped), far over the Workers bundle limit. chdb-cloudflare is a size-capped subset: the engine is profiled against the most common SQL and only that hot set ships, as one chdb.wasm of ~8.4 MiB gzipped. Everyday analytics is covered: the common operators, functions and aggregates over the common column types; querying data you load into the Worker (putFile + file(), or inline via format()/values()); remote reads with url() and s3(); Memory tables, sessions, streaming, and the common input/output formats.

To stay under the size limit, everything else is left out — notably MergeTree tables and the data-lake stack (Iceberg/Delta/catalogs). Calling an unsupported feature fails immediately with a clear error (the instance stays usable):

chdb-cloudflare: this SQL feature is not included in this size-optimized Cloudflare Workers build; use the full chdb-wasm package

Networking runs on JSPI. The full package's HTTP bridge waits synchronously (sync XHR in browsers, a subprocess in Node), which Cloudflare's workerd cannot do. This package instead links with WebAssembly JavaScript Promise Integration: the wasm stack suspends at a plain async fetch() and resumes when it settles — zero size cost, and it is exactly what makes url()/s3() work inside Workers. The trade-off: it requires a JSPI-capable engine — workerd (Cloudflare Workers), Chrome/Edge 137+, or Node 24+ with --experimental-wasm-jspi.

The bundle is single-threaded (Workers has no threads) and links with a 64MB initial memory (growable; a Workers isolate caps total memory at 128MB).

Usage (Cloudflare Workers)

workerd has no Worker API, so use the dedicated Workers entry — it wraps the module wiring (deploy-time compiled wasm via instantiateWasm, locateFile) and, importantly, serializes engine calls: one isolate serves concurrent requests, and a query suspended at fetch() (JSPI) must not be re-entered by another request.

import createChdbModule from 'chdb-cloudflare/chdb.mjs';
import wasmModule from 'chdb-cloudflare/chdb.wasm';
import { createChdb } from 'chdb-cloudflare/workers';

let dbPromise = null;
export default {
  async fetch(request) {
    const db = await (dbPromise ??= createChdb(createChdbModule, wasmModule));
    const r = await db.query("SELECT count() FROM url('https://…/data.csv', CSVWithNames)");
    return new Response(r.text());
  },
};

db.putFile(path, bytes) feeds data to file(), and db.connect() opens a session (query, queryStream, close). Default wrangler bundling works as-is; the build prints a warning that node:module (imported by the Emscripten glue) is Node-only — it is harmless, that import never executes in workerd, and no nodejs_compat flag is needed.

Other runtimes

The package also runs outside Workers on any JSPI engine (Chrome/Edge 137+, Node 24+ with --experimental-wasm-jspi), with the same AsyncChdb API as chdb-wasm — handy for testing the exact bundle you deploy:

import { AsyncChdb } from 'chdb-cloudflare';

const db = await AsyncChdb.create({
  moduleUrl: import.meta.resolve('chdb-cloudflare/chdb.mjs'),
});
console.log((await db.query('SELECT version()', 'CSV')).text());

If you need the data-lake stack (Iceberg/Delta/catalogs), MergeTree, or a non-JSPI runtime, use the full chdb-wasm package.