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

@ai-path/tb-collab

v0.3.0

Published

Realtime collaboration primitives for Taible: a table-specific LWW CRDT, fractional indexing for stable row/column order, presence, and a transport abstraction.

Readme

@ai-path/tb-collab

Realtime collaboration primitives for Taible. It provides a last-writer-wins CRDT for cell values (TableDocument), a presence registry for remote cursors and selections, a transport abstraction with an in-memory implementation for tests and local demos, and CollabSession which wires them together into the single object a UI layer talks to. Fractional order keys (keyBetween) support stable ordering of inserted rows/columns.

Install

pnpm add @ai-path/tb-collab

API overview

CollabSession + InMemoryNetwork

A CollabSession applies and broadcasts local edits and merges remote ones. The InMemoryNetwork connects multiple sessions in-process — ideal for tests.

import { CollabSession, InMemoryNetwork } from '@ai-path/tb-collab';

const network = new InMemoryNetwork();
const alice = new CollabSession('alice', network.connect(), { name: 'Alice', color: '#e11' });
const bob = new CollabSession('bob', network.connect(), { name: 'Bob' });

alice.setCell('A1', 'hello');
bob.doc.get('A1'); // 'hello' — replicated through the network

alice.updatePresence({ cursor: 'B2' });
alice.leave();

TableDocument (CRDT)

TableDocument is a self-contained LWW cell store. setLocal produces a CellOp to broadcast; applyRemote merges an incoming op; merge folds in another document's ops.

import { TableDocument } from '@ai-path/tb-collab';

const doc = new TableDocument('site-1');
const op = doc.setLocal('A1', 42);
doc.get('A1');     // 42
doc.snapshot();    // { A1: 42 }

const other = new TableDocument('site-2');
other.applyRemote(op);

Presence

import { PresenceRegistry, type PresenceState } from '@ai-path/tb-collab';

const presence = new PresenceRegistry();
presence.set({ site: 'bob', name: 'Bob', cursor: 'C3' } as PresenceState);
presence.remove('bob');

Order keys

keyBetween / keysBetween generate fractional-index strings for ordering inserted items; isOrderKey validates them.

import { keyBetween } from '@ai-path/tb-collab';

const k = keyBetween(null, null);  // first key
const k2 = keyBetween(k, null);    // sorts after k

To bridge a real backend, implement the CollabTransport interface (send + subscribe) and pass it to CollabSession in place of the in-memory transport.