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

@siltrun/react

v0.1.2

Published

Silt React binding — useRoom(url, { id }) → { state, send } over one @siltrun/client connection.

Readme

@siltrun/react

The React binding for Silt. One hook wraps the @siltrun/client connection so a component reads authoritative room state and sends intent — no provider, no store wiring.

npm install @siltrun/react

useRoom

const { state, send } = useRoom<GameState>(url, { id });
  • state — the room's latest authoritative state, typed GameState | undefined: undefined until the first server broadcast arrives; the component re-renders on every update after that. The type parameter is your declared shape of the room state (the wire is untyped JSON — it's a cast, not a runtime check); omit it and state is unknown.
  • send(data) — droppable datagram intent (latest-wins), for high-frequency signals like pointer position. send(data, { reliable: true }) routes on the ordered event lane.
  • id — a stable client identity, captured once at mount. A fresh value each render (e.g. an inline crypto.randomUUID()) still means one identity per mounted component.

Connections dedupe by url + id at module scope: two components pointed at the same room share a single socket, and the last unmount closes it. StrictMode-safe.

The full client (from the quickstart)

import { useRoom } from "@siltrun/react";

type GameState = { ships: Record<string, { x: number; y: number }> };

export default function Game() {
  const { state, send } = useRoom<GameState>("http://localhost:4000", { id: crypto.randomUUID() });
  if (!state) return <p>joining…</p>;
  return (
    <svg width={520} height={280} style={{ background: "#050505" }}
         onPointerMove={(e) => send({ x: e.nativeEvent.offsetX, y: e.nativeEvent.offsetY })}>
      {Object.entries(state.ships).map(([id, s]) => (
        <circle key={id} cx={s.x} cy={s.y} r={8} fill="#f59e0b" />
      ))}
    </svg>
  );
}

That exact file is kept typechecked against a stock Vite TS template, so it compiles as written.

Open two tabs and drag in one: the ship moves in both, driven by the server. send() is your intent, state is the authoritative world. The full walkthrough is at https://silt.run/docs/quickstart/.

Peer dependency: react >= 18 (the hook uses useSyncExternalStore).

Docs

Full guides and API reference: https://silt.run/docs/