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

archipelago-client

v1.0.1

Published

TypeScript client library for the Archipelago multi-game randomizer platform

Readme

archipelago

npm version Node >=24 GitLab CI Codecov

TypeScript client library for the Archipelago multi-game randomizer platform. Provides a dual client — WebSocket for real-time events and WebHost for REST API access — with zero production dependencies.

Installation

npm install archipelago-client

Requires Node.js 24+ (uses built-in WebSocket and fetch).

Quick Start

import { ArchipelagoClient, Game } from 'archipelago-client';

const client = new ArchipelagoClient({ host: 'archipelago.gg', port: 38281 });

client.on('ItemSend', (item) => {
  console.log(`${item.player.name} received ${item.item.name}`);
});

await client.connect();
await client.authenticate('MyBot', new Game('Hollow Knight'), 'slot');

Examples

| Example | Description | |---------|-------------| | WebSocket events | Connect, authenticate, listen to ItemSend and other events | | DeathLink | Send and receive DeathLink events via bounce packets | | WebHost REST | Query room_status, tracker, and datapackage endpoints |

Run any example with npx tsx examples/<name>.ts (server configuration at the top of each file).

Cache: The WebSocket example demonstrates optional client-side caching (useCache: true) to persist game datapackages between sessions.

Testing

The project uses archipelago.gg for E2E testing. Test infrastructure lives in the sibling test-archi/ directory.

Setting Up a Test Room

cd ../test-archi
npm run generate    # Generate a seed on archipelago.gg
npm run host        # Host the game server

This generates a test seed on archipelago.gg and saves room information to test-archi/.room-info.json.

Running Tests

npm test              # Run the full test suite (Vitest)
npm run test:e2e      # Run E2E tests (requires a hosted room on archipelago.gg)

Note: E2E tests require a room to be hosted on archipelago.gg. Set one up with cd ../test-archi && npm run generate && npm run host.

For detailed setup, see the Test Infrastructure Documentation.

API Overview

| Class | Description | Events | |-------|-------------|--------| | ArchipelagoClient | WebSocket client for real-time multiworld communication | connect, disconnect, error, ItemSend, HintUpdate, Bounce, RoomUpdate, … | | WebHostClient | REST client for the Archipelago WebHost API | — | | EventManager | Generic typed event emitter | Extensible | | PrintJSONManager | High-level PrintJSON event router | 16 PrintJSONType events | | Game | Game identifier (extends Tagged) | — | | Player | Network player representation | — | | Item | Network item representation | — | | Hint | Hint data structure | — |

Error Classes

| Class | Description | |-------|-------------| | ArchipelagoError | Base error class | | ArchipelagoConnectionError | WebSocket connection failures | | ArchipelagoAuthError | Authentication errors | | ArchipelagoPacketError | Packet parsing errors | | ArchipelagoWebHostError | Base WebHost error | | ArchipelagoWebHostNotFoundError | 404 responses | | ArchipelagoWebHostRateLimitError | 429 rate limit responses | | ArchipelagoWebHostServerError | 5xx server errors |

For the complete API reference, see the TypeDoc documentation.

Contribuer

| Command | Description | |---------|-------------| | npm run build | Compile TypeScript to dist/ | | npm test | Run the test suite (Vitest) | | npm run lint | Lint with Biome | | npm run docs | Generate TypeDoc HTML in docs/ |

Conventions

  • Commits : Conventional Commits (enforced by commitlint + husky).
  • Suffixes de fichiers : .class.ts, .enum.ts, .interface.ts, .type.ts pour une lisibilité immédiate.
  • Zéro dépendance production : la library ne dépend que des APIs natives Node.js 23+ (WebSocket, fetch, node:fs, node:crypto).