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

@wwind/client

v0.2.0

Published

Browser-side WebSocket client and wire types for @wwind/native runtimes. Zero-dep core, optional React bindings.

Readme

@wwind/client

Browser-side WebSocket client and wire types for @wwind/native runtimes.

Zero dependencies. Framework-agnostic. Targets ES2022 + DOM. Use it from React, Vue, Svelte, Solid, vanilla, anything.

Install

npm install @wwind/client

Use

import { WarmwindClient, type ViewFrame } from "@wwind/client";

const client = new WarmwindClient({
  wsUrl:    "wss://your-app.warmwind.space/ws",
  httpBase: "https://your-app.warmwind.space",
});

client.onConnect((connected) => console.log("ws", connected));
client.onFrame((frame: ViewFrame) => render(frame));

client.connect();

// Invoke an action exposed by the runtime.
await client.invoke("pdf-viewer.open", { path: "/files/manual.pdf" });

// History controls.
await client.undo();
await client.redo();
await client.jump(3);

When the app is served from the same origin as the runtime (the common case), both wsUrl and httpBase can be omitted. The client will derive ws(s)://<host>/ws and use relative HTTP paths.

Auth-validating proxies

Pass getToken when the runtime sits behind an auth-validating proxy. It runs fresh before every WebSocket open and every HTTP call, so an upstream refresher can rotate the token without reconnecting the client:

const client = new WarmwindClient({
  wsUrl:    "wss://gateway.warmwind.space/app/<id>/ws",
  httpBase: "https://gateway.warmwind.space/app/<id>",
  getToken: () => session.fetchAccessToken(),
});
  • WebSocket: appended as ?token=<value> (&token= if the URL already has a query string).
  • HTTP: sent as Authorization: Bearer <value> on every request.

React

import {
  useWarmwindClient, useWarmwindFrame,
  useWarmwindConnection, useWarmwindAction,
} from "@wwind/client/react";

function App() {
  const client    = useWarmwindClient({ getToken });
  const frame     = useWarmwindFrame(client);
  const connected = useWarmwindConnection(client);
  const open      = useWarmwindAction(client, "pdf-viewer.open");

  if (!connected) return <Spinner />;
  if (!frame)     return null;
  return <Renderer view={frame.view} onOpen={(p) => open({ path: p })} />;
}

react is an optional peer dependency; the vanilla WarmwindClient import has no React in its closure.

Wire protocol

The runtime is the source of truth. The client subscribes to its view tree over a single WebSocket and posts user intents back over plain HTTP. No bespoke RPC, no client-side state machine.

Server → client (over WS)

{ kind: "frame";  rev: number; frame: ViewFrame }
{ kind: "patch";  baseRev: number; rev: number; patches: ViewPatchOp[] }
{ kind: "reload"; reason?: string }
  • frame carries a full view snapshot (view, stack, tools, history). Sent on connect and after any change the runtime decides is too large to send as a delta.
  • patch is a batch of RFC 6901 JSON-Patch ops applied on top of the previous frame. Drop the patch and refetch via GET /api/view if baseRev !== latest_rev.
  • reload is a dev-mode signal that the renderer bundle changed.
  • rev is monotonic per session.

Client → server (over HTTP)

POST /api/invoke   { action_id: string, inputs: object } → InvokeResult
POST /api/undo                                            → 204
POST /api/redo                                            → 204
POST /api/jump     { index: number }                      → 204
GET  /api/view                                            → ViewFrame
                       (response header: X-Warmwind-Rev)

InvokeResult is { ok: true, result? } | { ok: false, error: { code, message } }.

That's the entire surface.

Types

All wire types are exported and stable across SDK minor versions:

import type {
  ViewFrame, ViewNode, ViewAction, ActionInput,
  DerivedView, ToolDescriptor, HistoryFrame,
  PageView, PageMode,
  ViewPatchOp, WireMessage,
} from "@wwind/client";

applyPatch(frame, op) and applyPatches(frame, ops) are exposed if you need to apply deltas yourself.

License

MIT