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

@miadi/stateloom

v0.1.2

Published

socket.io hub for the smcraft real-time design bridge: in-memory doc + seq per room, presence, chokidar external-edit differ, mtime/hash dedup

Readme

@miadi/stateloom

npm

The socket.io hub of the stateloom real-time design bridge: one in-memory document and sequence per room, presence, an external-edit differ, and mtime/hash dedup.

Install

npm install @miadi/stateloom

What it is

A pure sequencer and broadcaster. Clients join a room, send granular patch ops or whole definitions, and the hub assigns the authoritative monotonic seq, keeps the current definition in memory, and rebroadcasts to the room. A chokidar watcher notices when the file changes on disk behind everyone's back and turns that into the same patch ops a client would have sent.

The hub never writes disk. Each mutating client persists through its own durable channel and stamps the resulting mtimeMs on the frame it emits; the hub keeps the last 20 {mtime, hash} pairs per room so a writer's own file-watcher echo is recognised and dropped instead of looping.

It is not an HTTP API and not a UI. It serves many documents at once — one room per docId, and a docId is a normalized absolute file path, which is what lets a terminal, a browser tab and an agent that each name the same file end up in the same room.

Run it

npx @miadi/stateloom          # via the bin below
smcraft-bridge                # once installed

| Environment variable | Default | Meaning | |---|---|---| | STATELOOM_BRIDGE_PORT | 4599 | Port to bind | | STATELOOM_BRIDGE_HOST | 127.0.0.1 | Interface to bind | | STATELOOM_PROJECT_FILE | — | Default docId, and the durable file the watcher follows | | STATELOOM_BRIDGE_TOKEN | — | Optional handshake auth token |

The legacy SMCRAFT_* twin of each name is still honored.

Usage

Embed the hub in a process of your own — a test, a dev server, a desktop shell:

import { startBridge } from "@miadi/stateloom";

const handle = await startBridge({
  port: 4599,                                   // 0 picks an ephemeral port
  host: "127.0.0.1",
  file: "/abs/path/to/statemachine.smdf.json",  // seeds the default room
  token: process.env.STATELOOM_BRIDGE_TOKEN,
  cors: true,
});

console.log(handle.url);   // "http://127.0.0.1:4599"
console.log(handle.port);

await handle.close();

Connect to it with @miadi/stateloom-client, or from React with @miadi/stateloom-react.

Also exported

| Name | Purpose | |---|---| | startBridge(opts) | Boot the hub; resolves a BridgeHandle | | normalizeDocId(path) | The absolute-path normalization rooms are keyed by | | readDefFile(path) | Read and parse a .smdf.json from disk | | mtimeOf(path) | Millisecond mtime, or 0 when absent | | watchRoom(...) | The chokidar external-edit differ, standalone | | DEDUP_RING_SIZE | How many {mtime, hash} pairs a room retains (20) | | Room, RingEntry, LivePresence, StartBridgeOpts, BridgeHandle | Types |

Part of the stateloom stack

| Package | Role | |---|---| | @miadi/stateloom-engine | State machine engine: parser, validator, interpreter, code generators | | @miadi/stateloom-protocol | Patch ops, diff/apply, layout, renderers — zero runtime deps | | @miadi/stateloom | socket.io hub holding the live document — this package | | @miadi/stateloom-client | Framework-agnostic client for the hub | | @miadi/stateloom-react | React binding over the client | | @miadi/stateloom-cli | smcx — terminal design surface and renderers | | @miadi/stateloom-mcp | MCP server so LLM agents can design machines |

License

MIT © Guillaume Isabelle