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

@open-matrix/federation

v0.2.2

Published

Matrix federation layer: mailbox-based cross-realm messaging with legacy (matrix3) and modern (mxenv1) wire format support, security guardrails, and mqtt.js transport adapter.

Readme

@matrix/federation

Matrix federation layer for cross-realm messaging with:

  • Tolerant MXURI parsing (legacy compact + segmented /-/ form)
  • Dual mailbox namespaces (Strangler Fig)
    • legacy: public.ingress.<realm> (Matrix-3 compatibility)
    • mx ingress: mx/in/1/<realm>/<shard> (MXINGRESS/1)
  • Dual envelope profiles (Strategy)
    • legacy: Matrix-3 request/reply envelopes
    • mxenv1: MXENV/1 envelopes (Cmd|Evt|Result|Sub|Unsub|Nack)
  • Edge gateway bridging mailbox messages ↔ internal bus (mx/1/<realm>/<toPath>)
  • Federation subscription leasing (streaming Evt forwarding)
  • Session directory (principal → active tab realms) for unsolicited push
  • Hierarchical routing overlay (MXROUTE-style route inbox forwarding)
  • Pluggable transport with in-memory brokers for deterministic tests

No external npm dependencies are required to run unit + integration tests.

Run

npm test

Read the full design

Start with DESIGN.md.

Code map

  • Encoding + routing primitives

    • src/uri.ts — tolerant MXURI parsing + canonicalization
    • src/topics.ts — mailbox topics + internal topics + route inbox topics
    • src/envelope.ts + src/envelope_codec.ts — legacy + MXENV/1 envelopes, tolerant decoding, profile-specific encoding
  • Transports

    • src/transport/base.ts — transport port
    • src/transport/inmem.ts — in-memory exact-match broker + MQTT-filter broker
  • Runtime components

    • src/runtime/edge_gateway.ts — mailbox ↔ internal bus bridge
    • src/runtime/component_host.ts — helper for registering internal "accepts" handlers
    • src/runtime/federation.ts — subscription leases + Evt forwarding
    • src/runtime/directory.ts — session directory + protocol facade
    • src/runtime/router.ts — hierarchical routing overlay bridge
    • src/runtime/discovery.ts + src/runtime/resolved_client.ts — endpoint resolution + fallback client
  • Security building blocks

    • src/security/* — replay cache, rate limiter, policy hooks, principal derivation
  • Tests

    • tests/unit/* — codecs and matching
    • tests/integration/* — end-to-end request/reply, subscriptions, directory push, discovery fallback, routing overlay, security