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

onelobby

v0.6.0

Published

Multiplayer for browser games: host/join lobbies by short code, peer-to-peer WebRTC, lockstep sync, text and voice chat. Zero runtime dependencies; works from a plain <script> tag.

Readme

onelobby

Multiplayer for browser games. Players host a lobby, share a six-letter code, and join each other over peer-to-peer WebRTC. Includes lockstep sync, raw messages, text chat and voice chat. No runtime dependencies.

You need a OneLobby lobby server (the WebSocket URL, like wss://lobby.example.com/ws). See the docs to run one.

Use it from a <script> tag (no build tools)

<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/onelobby.global.min.js"></script>
<script>
  const kit = new OneLobby.OneLobby({
    gameId: "com.you.yourgame",            // any unique name for your game
    netVersion: "1",
    lobbyServer: "wss://lobby.example.com/ws",
    mode: "raw",
  });
  // Host:  const lobby = await kit.host({ name: "My game", maxPlayers: 4 }); show OneLobby.formatCode(lobby.code)
  // Join:  const lobby = await kit.join("C5A FX8");
</script>

The file also works saved next to your page (<script src="onelobby.global.min.js">), including pages opened from disk.

No code at all

After the <script> tag above, this gives a complete lobby box (the sentence inside only shows if the script did not load):

<one-lobby server="https://your-name.onrender.com" game="my-game" max-players="4">
  If you can read this, the OneLobby script didn't load.
</one-lobby>

See the no-code guide.

Install with npm

npm install onelobby
import { OneLobby, formatCode } from "onelobby";

const kit = new OneLobby({ gameId: "com.you.yourgame", netVersion: "1", lobbyServer: "wss://lobby.example.com/ws" });
const lobby = await kit.host({ name: "My game", maxPlayers: 4 });
console.log("Tell your friend this code:", formatCode(lobby.code));

Without a bundler: import { OneLobby } from "https://cdn.jsdelivr.net/npm/[email protected]/dist/onelobby.bundle.mjs".

Made for players

  • Lobbies are unlisted by default: friends join with the code or a link (OneLobby.shareUrl(lobby.code) makes https://your.game/?join=C5A-FX8; OneLobby.codeFromUrl() reads it back). Pass visibility: "public" to list it.
  • Players without a name show as "Player 2", "Player 3", ...
  • A joiner that can't connect gets an error after 15 s (readyTimeoutMs) instead of waiting forever: code ice_failed, and sessionEnded with that reason. One relay retry happens first when the server offers TURN.
  • A page reload keeps the seat (rememberSeat, on by default): kit.join(sameCode) or kit.resume() takes it back; kit.rememberedCode says which lobby.
  • OneLobby.describeError(err) turns any error into { message, hint } you can show as-is.
  • Test seams go under advanced: { socketFactory, linkFactory, clock, storage, ... }.

Files

| Import | What | |---|---| | onelobby | the public API: OneLobby, Lobby, Lockstep, Chat, Voice, OneLobbyError, normalizeCode, formatCode, describeError, shareUrl, codeFromUrl | | onelobby/ui | the <one-lobby> drop-in element (host, join, invite link, players, start); also in the <script> build | | onelobby/testing | in-memory server, peer network and clock for your own tests | | onelobby/internals | low-level pieces (codec, chunking, migration, jitter buffer, ...); no stability promise | | dist/onelobby.global.min.js | the <script> build; sets window.OneLobby |

Guides, recipes and the API reference: OneLobby docs. MIT license.