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

@magmacrunch/adenosine-multiplayer

v0.4.4

Published

Game-agnostic multiplayer WebSocket client for browser games

Readme

@magmacrunch/adenosine-multiplayer

Game-agnostic multiplayer WebSocket client — lobby, rooms, colour picking, chat and turn relay, plus a board-game HTML template. No runtime dependencies.

npm install @magmacrunch/adenosine-multiplayer

Use

import { MP, MSG, BoardGameTemplate } from '@magmacrunch/adenosine-multiplayer';

MP.onWelcome     = (data)   => console.log('joined room', data.room);
MP.onGameStarted = (data)   => startGame(data);
MP.onGameAction  = (action) => handleAction(action);

MP.connect();
MP.join('Player1', '#ff2d55');

MP.sendAction({ type: 'play_card', card }) relays a move to the other players; MSG holds the protocol's message-type constants and MP_PALETTE the colours the lobby offers.

Board game scaffolding

document.body.innerHTML = BoardGameTemplate.render({
  title: 'CHESS',
  instructions: '<h3>Rules</h3><p>…</p>',
  credits: '<h3>Chess</h3><p>Your name here</p>',
});

render() returns markup; it does not insert it. Note that <script> elements in a string assigned through innerHTML never execute — load your game scripts with real tags.

Configuration

With nothing configured, MP.connect() targets the origin that served the page, choosing wss: or ws: from the page protocol.

MP.configure({
  defaultServer: 'games.example.com/chess',   // bare host[:port][/path]
  allowlist: ['games.example.com'],           // hosts a ?server= link may name
});

Prefer a bare host over a ws://-prefixed value: a value already starting with ws is used verbatim, which silently defeats protocol selection on https: pages. Private ranges (RFC1918) and loopback are always allowed so LAN and dev play keep working; anything else a ?server= link names must be in allowlist, or it is ignored and logged.

Server — you need one, and this package is not it

This is the client half only. Nothing here listens; MP.connect() expects a WebSocket server that keeps rooms and relays frames between the players in one. No such server ships with this package, so a fresh install has nothing to talk to until you provide one.

PROTOCOL.md specifies the whole wire format — every frame in both directions with its fields, plus the six things a minimal server must do. It is short, and writing a server against it is a normal afternoon's work in any language with a WebSocket library.

Without a bundler

Straight from a CDN — no npm, no build step:

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@magmacrunch/[email protected]/lobby.css">
<script src="https://cdn.jsdelivr.net/npm/@magmacrunch/[email protected]/dist/index.global.js"></script>

The IIFE build exposes window.AdMP. The version is pinned to a minor here on purpose: an unpinned URL follows latest and will cross a major without warning.

Installed from npm instead, the same file is dist/index.global.js.

Full API

API.md documents every export, with parameters and return shapes.

Theming

| Property | Default | What it colours | |---|---|---| | --accent | #00f5ff | Borders, titles, focus | | --gold | #ffe03a | Host badge, primary button | | --bg-dark | #060e1a | Overlay backdrop | | --bg-mid | #1a2a44 | Panel | | --border | #1a2a44 | Dividers | | --cream | #f0ead8 | Body text | | --slate | #4a6a7a | Muted text | | --font-pixel / --font-mono | Press Start 2P / VT323 | Headings / body |

Glows and translucent fills derive from --accent and --bg-dark through color-mix, so overriding the accent recolours them too rather than leaving a cyan halo behind.

Derived colours use color-mix(), which needs Chrome 111, Safari 16.2 or Firefox 113 — all shipped in 2023.

Module format

ESM only. The exports map declares no require condition, so this cannot be require()d from CommonJS — use import, or the IIFE build above.

License

Apache-2.0 — Copyright 2026 Magma Crunch Media.

Part of adenosine, a collection of lightweight web game engines by magmacrunch media. Keep the NOTICE file with any copy you distribute.