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/dsl

v0.1.1

Published

OpenFGA DSL → @zanzibar-ts/core model bridge — lower existing OpenFGA DSL text to a validated zanzibar-ts model (a build-time / migration tool, never in the core bundle)

Readme

@zanzibar-ts/dsl

Lower an existing OpenFGA DSL model (the model … schema 1.1 … text) to a validated @zanzibar-ts/core model — migrate without rewriting your model by hand. It wraps @openfga/syntax-transformer, so the parse is byte-faithful to what OpenFGA itself ingests.

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

// paste your existing OpenFGA DSL verbatim
const model = modelFromDsl(`
  model
    schema 1.1
  type user
  type group
    relations
      define member: [user, group#member]
  type document
    relations
      define editor: [user, group#member]
      define viewer: [user, group#member] or editor
`);

const engine = createEngine(model);
await engine.write([
  { object: 'group:eng', relation: 'member', subject: 'user:anne' },
  { object: 'document:readme', relation: 'editor', subject: 'group:eng#member' },
]);

// editors are viewers (the `or editor` union), and the grant flows through the group:
assertEquals(
  await engine.check({ object: 'document:readme', relation: 'viewer', subject: 'user:anne' }),
  { ok: true, value: true },
);

modelFromDsl throws a DslError if the text doesn't parse (category: 'syntax') or is semantically invalid (a dangling reference, a bad rewrite), so a broken model fails loudly at load. Need just the JSON? dslToJson(dsl) returns the OpenFGA JSON model without validating.

Why a separate package

@zanzibar-ts/dsl is not part of @zanzibar-ts/core and is never in its bundle — the syntax-transformer (and its OpenFGA SDK dependency) is large, and the edge bundle must stay small. Use it at build time, or once to port a model. For models authored fresh, prefer the typed defineModel builder — it's checked by tsc and has no heavy dependency.

@zanzibar-ts/dsl bundles @openfga/sdk into its dependency closure to work around an upstream bug (@openfga/syntax-transformer require()s the SDK without declaring it), so the install is self-contained.

See the migration recipe for the full walkthrough.

License

MIT