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

wireweave

v0.3.20

Published

nostr + webrtc voice + data SDK. networking layer for 247420 projects.

Downloads

3,261

Readme

wireweave

probably emerging 🌀

serverless nostr + webrtc voice + binary-data SDK. the networking layer for 247420 projects.

  • voice — perfect-negotiation mesh + SFU election (audio, video, recorded segments).
  • data — peer-to-peer binary RTCDataChannel over the same nostr signaling. game frames, structured payloads, anything Uint8Array-shaped.

site: https://anentrypoint.github.io/wireweave/
npm: https://www.npmjs.com/package/wireweave

npm i wireweave

one-liner setup

import { createWireweave } from 'wireweave';
import * as NostrTools from 'nostr-tools';
import * as XState from 'xstate';

const ww = createWireweave({ nostrTools: NostrTools, xstate: XState });
ww.pool.connect();
ww.auth.loadFromStorage() || ww.auth.generateKey();
ww.servers.init();

ww exposes: pool, auth, fsm, message, bans, roles, settings, pages, media, channels, servers, chat, voice (lazy via ensureVoice()), setCurrentChannel().

every submodule is an EventTarget. subscribe with addEventListener('event', ...).

modules

import {
  RelayPool, NostrAuth, VoiceSession, DataSession, Chat, Channels, Servers,
  Bans, Roles, Settings, Media, Pages, MessageBus, createFSM
} from 'wireweave';

each also exported via subpath: wireweave/relay-pool, wireweave/voice, wireweave/data, wireweave/chat, etc.

data sessions (binary p2p)

DataSession mirrors VoiceSession's perfect-negotiation peer setup but carries only an ordered binary RTCDataChannel — no media, no mic prompt, no SFU. Use it for game state, file sync, anything ArrayBuffer-friendly.

import { createDataSession, createFSM, NostrAuth, RelayPool } from 'wireweave';
import * as NostrTools from 'nostr-tools';
import * as xstate from 'xstate';

const fsm = createFSM(xstate);
const auth = new NostrAuth({ nostrTools: NostrTools });
auth.loadFromStorage() || auth.generateKey();
const pool = new RelayPool({ verifyEvent: NostrTools.verifyEvent });
pool.connect();

const session = createDataSession({ fsm, xstate, relayPool: pool, auth, namespace: 'mygame' });
session.addEventListener('peer-open',  (e) => console.log('peer up', e.detail.peerPubkey));
session.addEventListener('data',       (e) => handleFrame(e.detail.peerPubkey, e.detail.data));
session.addEventListener('peer-close', (e) => console.log('peer down', e.detail.peerPubkey));

await session.connect('lobby-7'); // any room name; URL-hash works fine
session.broadcast(new Uint8Array(payload));     // → all open peers
session.send(somePeerPubkey, new Uint8Array(p)); // → one peer

Options: dataChannelOptions (default { ordered: true }) and iceServers (override the default STUN/TURN list). Construct multiple DataSessions in the same page to use distinct rooms / channel configurations.

game / 3-mode usage pattern

For projects (e.g. multiplayer games) that need three transport flavours:

| mode | wireweave usage | |---|---| | singleplayer (in-page) | VoiceSession keyed by location.hash so people on the same URL voice-chat; game state stays in a Worker | | webrtc host & join | DataSession for game frames, VoiceSession for voice — both signaled through the same nostr relays | | self-hosted server | server runs its own transport for state; DataSession adds player↔player p2p (voice + side-channel data) over nostr |

namespace partitions rooms across deployments (e.g. 'spoint-prod' vs 'spoint-dev').

voice (webrtc mesh + sfu hub election)

const voice = ww.ensureVoice({
  serverId: 'abc:xyz',
  displayName: 'you',
  onAudioTrack: ({ peer, stream }) => {
    const a = new Audio();
    a.srcObject = stream;
    a.autoplay = true;
    document.body.appendChild(a);
    peer.audioEl = a;
  },
  onVideoTrack: ({ peerPubkey, stream }) => { /* attach to <video> */ }
});
await voice.connect('general-voice', { displayName: 'you' });
voice.toggleMic();
voice.toggleDeafen();
voice.addEventListener('participants', e => console.log(e.detail.list));

Voice carries every empirically-discovered reliability pattern: perfect negotiation (RFC 8840), ICE restart on disconnect, track-stall detection, SFU hub election (mesh→star at 3+ peers), exponential-backoff reconnect.

node usage (relay + auth only)

import WebSocket from 'ws';
import { RelayPool, NostrAuth } from 'wireweave';
import * as NostrTools from 'nostr-tools';

const pool = new RelayPool({ relays: ['wss://relay.damus.io'], verifyEvent: NostrTools.verifyEvent, WebSocketImpl: WebSocket });
const auth = new NostrAuth({ nostrTools: NostrTools });

test

npm test

hits wss://relay.damus.io for a real publish → subscribe round-trip.

license

MIT © AnEntrypoint — read the source.