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

@zanzibar-ts/core

v0.1.1

Published

TypeScript-native, Zanzibar-style ReBAC authorization engine — in-process ~µs checks, a typed model builder, conditions (CEL/ABAC), and a D1 store for Cloudflare Workers

Readme

@zanzibar-ts/core

A TypeScript-native, Zanzibar-style relationship-based authorization (ReBAC) engine.

You describe a permission model, store relationships (tuples) — who relates how to what — and ask check / list questions. It runs in-process: a check is a ~microsecond function call, not a network round-trip, and the engine bundles to ~28KB minified (~8KB gzip) for Cloudflare Workers and the edge (measured).

  • In-process / edge. No server, no network hop — works on Node, Bun, and Cloudflare Workers (with a bundled D1 store for durable, multi-tenant persistence).
  • TypeScript-native. The model is code, authored with a typed builder; queries are type-checked against it — a typo'd relation is a compile error.
  • Trustworthy by construction. Every release is proven by a five-way differential against OpenFGA, SpiceDB, a Datalog oracle, and an independent reference evaluator — plus property tests, fuzzing, and mutation testing. The provenance (AI-authored, verification-first) and the honest limits are disclosed in TRUST.md.

Quickstart

Define a model, create an in-memory engine, write a relationship, and check it. Anne is a member of the eng group, and the eng group is a viewer of the readme, so anne can view the readme:

import { deepStrictEqual as assertEquals } from 'node:assert/strict';
import { defineModel } from '@zanzibar-ts/core/model';
import { createEngine } from '@zanzibar-ts/core';

// 1. Define the model — types and how permissions are derived. Checked by `tsc`.
const authz = defineModel((t) => ({
  user: t.type(),
  group: t.type({
    // a group's members are users, or members of nested groups
    member: t.assign('user', 'group#member'),
  }),
  document: t.type({
    // a viewer is anyone assigned directly, OR a member of an assigned group
    viewer: t.assign('user', 'group#member'),
  }),
}));

// 2. Create an engine (in-memory by default).
const engine = createEngine(authz);

// 3. Write relationships.
await engine.write([
  { object: 'group:eng', relation: 'member', subject: 'user:anne' },
  { object: 'document:readme', relation: 'viewer', subject: 'group:eng#member' },
]);

// 4. Check. A decision is a Result VALUE — it never throws for "deny".
const decision = await engine.check({
  object: 'document:readme',
  relation: 'viewer',
  subject: 'user:anne',
});

assertEquals(decision, { ok: true, value: true }); // ✅ anne views the readme via group:eng#member

(The assertEquals alias only makes the example double as a CI-run test — in your app, branch on the returned Result instead.)

Beyond check: listObjects ("what can anne access?"), listUsers ("who can access this?"), expand (the membership tree), explain (why a decision happened), conditions (CEL-gated grants — ABAC), consistency tokens (read-your-writes on replicated stores), and versioned model storage.

Docs

Every ```ts block in the docs (including this one) is executed in CI.

Migrating from OpenFGA? @zanzibar-ts/dsl lowers existing OpenFGA DSL text to a validated model.

License

MIT