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

@cloviz/eq-mc

v0.1.7

Published

Poker equity calculator compiled to WebAssembly

Readme

@cloviz/eq-mc

WebAssembly poker equity calculator for Texas Hold'em.

Install

npm install @cloviz/eq-mc

Usage

import init, {
  calculate_combo_equity,
  calculate_combo_equity_exact,
} from "@cloviz/eq-mc"

await init()

const approximate = calculate_combo_equity("AsAh,KsKh", "", "", 100000)
const exact = calculate_combo_equity_exact("AsAh,KsKh", "", "")
const exactWithDeadCards = calculate_combo_equity_exact("AsAh,KsKh", "2c,7d,Ts", "Qc")

console.log({ approximate, exact, exactWithDeadCards })

API

calculate_combo_equity(combos, board, deadCards, trials)

Monte Carlo combo equity.

  • combos: comma-separated combos, for example "AsAh,KsKh"
  • board: comma-separated board cards, for example "2c,7d,Ts", or ""
  • deadCards: comma-separated cards to exclude, for example "Ad,Kc", or ""
  • trials: simulation count
  • returns comma-separated equities, for example "0.826370,0.173630"

calculate_combo_equity_exact(combos, board, deadCards)

Exact combo equity by exhaustive runout enumeration.

  • combos: comma-separated combos
  • board: comma-separated board cards, or ""
  • deadCards: comma-separated cards to exclude, for example "Ad,Kc", or ""
  • returns comma-separated equities

For preflop heads-up exact equity, this API can use an optional packed lookup table loaded with load_preflop_hu_table. Without the table it falls back to the normal exact path.

calculate_range_equity(ranges, board, deadCards, trials)

Monte Carlo range equity.

  • ranges: pipe-separated weighted ranges, for example "AsKs:1.0,AsKh:0.5|QhQd:1.0,QhQc:1.0"
  • board: comma-separated board cards, or ""
  • deadCards: comma-separated cards to exclude, for example "Ad,Kc", or ""
  • trials: simulation count
  • returns comma-separated equities

load_preflop_hu_table(bytes)

Loads an optional packed preflop heads-up exact equity table.

  • bytes: Uint8Array containing the EQPH binary table
  • returns true when the table was loaded, false when it was already loaded or the format is invalid

is_preflop_hu_table_loaded()

Returns whether the optional preflop heads-up table is loaded.

Packed Preflop HU Table Format

The table is intentionally not bundled into the npm package. It is meant to be served by applications that need low-latency preflop heads-up exact equity.

  • header: 16 bytes
  • magic: EQPH
  • version: 1
  • combo count: 1326
  • entries: upper triangle only, excluding identical combo pairs
  • entry size: 6 bytes
  • entry payload: firstWins and chops as little-endian unsigned 24-bit ints
  • total runouts per entry: 1_712_304

The canonical first/second order is the ascending combo-id order. Callers do not need to canonicalize hands before passing them to calculate_combo_equity_exact.