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

musrank

v0.1.2

Published

Weng-Lin Bayesian approximation method for online skill-ranking.

Readme

Musrank

Version tests Coverage Status Downloads License

MusRank is a skill-rating system for Mus that focuses on match length noise with a Weng-Lin / TrueSkill-style core. Outcomes are treated as win/loss only (no margin-of-victory signal).

Installation

npm install --save musrank

Quick start

import { rating, rate } from 'musrank'

const a1 = rating()
const a2 = rating()
const b1 = rating()
const b2 = rating()

const [[a1p, a2p], [b1p, b2p]] = rate([a1, a2], [b1, b2], {
  rank: [1, 2],
})

2v2 parameter exploration

Run a local sweep (2v2 only, no draws) and print a table with the result, parameter config, and Elo-style mu change:

npm run build
node exploration/matches-sim.mjs

The script runs two scenarios (A wins, B wins) for several parameter sets and prints a console table with:

  • result: scenario (A wins / B wins)
  • params: named parameter preset (tau values or beta scaling)
  • config: JSON of the preset options
  • eloChangeA / eloChangeB: average mu change per team

The model: two layers of uncertainty

Layer 1 — Hand-level randomness (β₀)

Each hand has:

  • card randomness
  • bidding variance

We model this base noise as β₀. Larger β₀ means outcomes are blurrier; smaller β₀ means skill dominates.

Layer 2 — Match aggregation (β(L))

Mus is played to L juegos (points). More games average out randomness, so the match-level noise shrinks with L.

Conceptually:

beta(L) = beta0 / sqrt(L)

Or with a reference match length:

beta(L) = beta0 * (Lref / L) ^ alpha

Where L is the number of juegos. Short matches are noisy; long matches are reliable.

Example (intuition): if beta(10) = 1.0

  • L = 2 → beta(2) ≈ 2.24 (chaotic, weak evidence)
  • L = 4 → beta(4) ≈ 1.58 (still swingy)
  • L = 20 → beta(20) ≈ 0.71 (stable, decisive)

What “more β” vs “less β” means

  • More β → more chaos. Upsets are common, a win provides weak evidence.
  • Less β → more determinism. Upsets are rare, a win is strong evidence.

In Mus terms: short matches → high β, long matches → low β.

Think of it like this:

  • beta(L) defines the noise (how much to trust a win/loss result)

So the same result gives:

  • a small update in a short match (high β)
  • a large update in a long match (low β)

Defaults you’ll choose later

These are the two core knobs:

  1. β₀ — base hand randomness
  2. σ₀ — prior uncertainty for new players

Rule of thumb: start with sigma0 ≈ 1–2 × beta(10) so new players can move meaningfully after a few matches.

Why this approach fits Mus

  • Short matches are noisy by nature — β(L) encodes that.
  • Ratings update fast for new players, slowly for established ones — σ₀ encodes that.

That separation keeps the math principled and lets Mus behave like Mus.