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

@databob/engine

v0.0.5

Published

The databob analytics runtime: typed event schemas, a JSON query language compiled to SQLite, per-tenant storage, embed tokens, and one HTTP API.

Readme

@databob/engine

The runtime behind @databob/sdk. Most apps install @databob/sdk; use this package to embed the engine or to host it.

schema (JSON) ──► prepareEvent ──► Tenants.insert ──► one SQLite database per tenant
metric (JSON) ──► compileQuery ──► Tenants.select ──► shapeAggregate / shapeFunnel
                    (bound SQL)
createHandler(): the HTTP API, identical on Node and Cloudflare

| File | What it does | | --- | --- | | values.ts | Validators. Plain JSON at runtime, typed at compile time | | schema.ts | defineSchema, event, and the checks that refuse personal-data property names | | privacy.ts | Value checks: email, IP, phone, card number | | events.ts | Turns an incoming event into a row: validates, hashes the user id, checks the tenant | | query.ts | The typed builder. It produces a JSON query, never SQL | | compile.ts | JSON query to SQLite. Fields are checked against the schema, values are bound | | time.ts | Time zones without a tz database in SQL: offset segments plus a CASE in the query | | store.ts | TenantStore over a 4-method SqlDriver, plus the Durable Object driver | | engine.ts | Engine: track, metric, query, erase. Projects and Tenants are the two ports | | http.ts | createHandler: auth (secret keys and embed tokens), routes, live server-sent events | | token.ts | HMAC-signed embed tokens scoped to one tenant and optionally a list of metrics | | node.ts | @databob/engine/node: node:sqlite driver, LocalTenants, StaticProjects, Node HTTP bridge |

Storage

Each tenant has its own database with one events table (ts, name, user hash, props JSON, idempotency key) and indexes on time, event and time, and user. Per-tenant data is small, so a query scans that tenant's rows directly; there are no rollup jobs and no snapshots. On Cloudflare each tenant is a Durable Object (cloud/), so an idle tenant costs nothing and dropping a tenant deletes its object's storage.

Ports

interface Projects { bySecretKey(key): Promise<ProjectConfig | null>; byId(id): Promise<ProjectConfig | null> }
interface Tenants {
  insert(projectId, tenant, rows); select(projectId, tenant, sql, params);
  eraseUser(projectId, userHash); drop(projectId, tenant);
  subscribe?(projectId, tenant, onChange); // live queries poll every 10s without it
}

Implement those two to run the engine anywhere SQLite runs.

License

FSL-1.1-ALv2 (LICENSE.md). Use it, change it, and self-host it, including inside a commercial product. Do not offer it as a competing hosted service. Each release becomes Apache-2.0 on its second anniversary.