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

@zabloo/format

v0.2.0

Published

The zabloo IR format: TypeScript types and envelope validation

Readme

@zabloo/format

The zabloo IR as code: the format's TypeScript types, and the reader that validates an envelope before an SDK trusts it.

Part of zabloo/ui — build your game's UI once in React, ship a compact engine-agnostic IR, and let a lightweight SDK draw it inside Unity, Godot or Unreal.

This package knows nothing about any engine or renderer. It is the node vocabulary, the envelope shape, the loading policy and the handful of algorithms every target must reproduce exactly (easing, binding resolution, item identity). @zabloo/react, @zabloo/renderer-web and every engine SDK are consumers of what lives here.

Install

npm install @zabloo/format

Reading an envelope

The IR is a payload consumed at runtime and hot-updatable, so an SDK routinely meets content authored by a different version of the tooling. readEnvelope never throws: it repairs what it can and reports everything it found.

import { readEnvelope } from "@zabloo/format";

const { envelope, diagnostics } = readEnvelope(await fetch(url).then((r) => r.text()));

for (const d of diagnostics) {
  console.warn(`[${d.level}] ${d.code} at ${d.path || "<envelope>"}: ${d.message}`);
}

// `null` means a fatal diagnostic stopped the load; anything else is renderable.
if (envelope !== null) render(envelope);

parseEnvelope is the throwing form, for build-time code where an invalid envelope is a bug rather than a payload to survive:

import { EnvelopeError, parseEnvelope } from "@zabloo/format";

try {
  const envelope = parseEnvelope(JSON.parse(json));
} catch (error) {
  if (error instanceof EnvelopeError) console.error(error.diagnostics);
}

DiagnosticCode is the stable contract ("unsupported-version", "unknown-token", …); the prose of message is free to improve.

Types

An envelope is the unit an SDK loads: a version, a flat token dictionary, the views, and an optional asset manifest.

import { type Envelope, IR_VERSION } from "@zabloo/format";

const envelope: Envelope = {
  v: IR_VERSION,
  tokens: { "color.primary": "#4f46e5", "space.4": 16 },
  views: {
    "main-menu": {
      type: "Container",
      layout: { justify: "center", align: "center", padding: "{space.4}" },
      children: [{ type: "Text", text: "Hello", style: { color: "{color.primary}" } }],
    },
  },
};

ZNode is a closed union — one member per node type an SDK implements. supportsVersion answers whether this reader can consume a given v.

Documentation

License

MIT