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

@zigbase/typegen

v0.1.2

Published

Generate a typed TypeScript client from a running ZigBase instance's schema — no Zig toolchain required.

Readme

@zigbase/typegen

Generate a fully typed TypeScript client from a ZigBase schema — no Zig toolchain required. The generator reads your schema offline from a provisioned data directory, or live over HTTP, and emits the typed db / realtime / files surface for use with @zigbase/client.

Quick start

# Offline — reads an already-provisioned data directory (no server needed):
npx @zigbase/typegen --data-dir ./zb_data --out src/zbase.gen.ts

# Live — against a running instance (superuser credentials required):
npx @zigbase/typegen --url https://api.example.com \
  --admin-email [email protected] \
  --admin-password 'your-password' \
  --out src/zbase.gen.ts

Schema sources (exactly one required)

| Flag | Behavior | | --- | --- | | --data-dir <path> | Offline. Reads the server's data directory directly — no auth, no running server required. The directory must already have been provisioned by a prior serve run; a freshly-created or empty data directory has no collections to read. | | --url <origin> --admin-email <e> --admin-password <p> | Live. Calls GET /api/collections on the running instance using superuser credentials. |

Flags

| Flag | Default | Purpose | | --- | --- | --- | | --out <file> | (required) | Path to write the generated TypeScript file. | | --api-prefix <p> | /api | API path prefix used in the generated client. | | --client-name <name> | ZbClient | Name of the generated client factory. | | --check | — | Staleness gate: exits non-zero if the out file is out of date without writing it. Useful in CI. |

Output

The generated file exports the typed db / realtime / files surface — a schema-aware client that calls into @zigbase/client + @zigbase/client/typed. It does not emit rpc.*: custom routes are not visible at runtime and require the comptime generator (zig build gen-client) if you have the Zig source.

Dependencies

The generated file imports @zigbase/client and its /typed subpath export. Both are included in a single package — one install covers everything:

npm install @zigbase/client

@zigbase/client/typed is a subpath export of @zigbase/client; no separate install is needed.

No Zig toolchain is needed — @zigbase/typegen bundles the codegen engine through @zigbase/server, which ships prebuilt platform binaries.

How it works

@zigbase/typegen depends on @zigbase/server, which resolves the correct platform binary via optional dependencies (@zigbase/server-linux-x64, @zigbase/server-linux-arm64, @zigbase/server-darwin-x64, @zigbase/server-darwin-arm64). The wrapper invokes the server's built-in typegen subcommand and writes the result to --out.

Supported platforms

  • linux-x64
  • linux-arm64
  • darwin-x64
  • darwin-arm64

(Windows support is not yet available.)

Requirements

  • Node.js >=18