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

@graphorin/protocol

v0.8.0

Published

Wire protocol contract for the Graphorin framework: Zod schemas + TypeScript types for the WebSocket subprotocol `graphorin.protocol.v1`. Defines the `ClientMessage` and `ServerMessage` discriminated unions, the JSON-RPC-shaped control channel (`initializ

Readme

@graphorin/protocol

Wire-format contract for the Graphorin framework's WebSocket subprotocol.

License: MIT Node.js: 22+

@graphorin/protocol is the single source of truth for the shape of every frame exchanged over wss://.../v1/ws. Both @graphorin/server and @graphorin/client import their schemas from this package so the two implementations cannot drift.

What ships in v0.1 (Phase 14b)

| Surface | Detail | |---|---| | Subprotocol | graphorin.protocol.v1 (SUBPROTOCOL_NAME). Browser clients attach a single-use ticket as a second Sec-WebSocket-Protocol token via formatTicketSubprotocol(ticket)'ticket.<value>'. | | Client → Server frames | Discriminated union ClientMessage covering initialize, subscription.subscribe, subscription.unsubscribe, run.cancel, ping, and the MCP-compatible notifications/cancelled notification. | | Server → Client frames | Discriminated union ServerMessage covering JSON-RPC responses (result / error), typed push events ({ kind: 'event', subject, type, payload, eventId }), lifecycle frames, async error frames, pong, subscribed / unsubscribed, and replay-marker. | | Close codes | Application-private 4xxx range per RFC 6455 § 7.4: 4001 auth.required, 4002 auth.invalid, 4003 auth.revoked, 4004 auth.scope_denied, 4005 rate.limited, 4006 flow.throttled, 4007 server.shutdown, 4008 protocol.violation. | | Bundle | Browser-friendly. Zero Node-only dependencies; the only runtime dependency is zod. |

Direct dependencies

  • zod (^3.25.0) - runtime schema validation. The MIT-licensed Zod project supplies the discriminated union, strict-object, and safeParse primitives that back every *Schema export. No other runtime dependency exists; the package is otherwise pure TypeScript.

Install

pnpm add @graphorin/protocol zod

Other npm-registry-compatible package managers (npm, yarn, bun) work identically.

Usage

import {
  ClientMessageSchema,
  ServerMessageSchema,
  SUBPROTOCOL_NAME,
  formatTicketSubprotocol,
  isEventFrame,
} from '@graphorin/protocol';

// 1. Validate an inbound client frame on the server.
const parsed = ClientMessageSchema.safeParse(JSON.parse(rawFrame));
if (!parsed.success) {
  ws.close(4008, 'protocol.violation');
  return;
}

// 2. Build the subprotocol header for a browser client.
ws.subprotocol = `${SUBPROTOCOL_NAME}, ${formatTicketSubprotocol(ticket)}`;

// 3. Narrow a server frame on the client.
const incoming = ServerMessageSchema.parse(JSON.parse(rawFrame));
if (isEventFrame(incoming)) {
  console.log(incoming.subject, incoming.type, incoming.payload);
}

License

MIT © 2026 Oleksiy Stepurenko. See LICENSE.


Project Graphorin · v0.8.0 · MIT License · © 2026 Oleksiy Stepurenko · https://github.com/o-stepper/graphorin