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

@taipeistudio/gamekit-competition

v0.3.0

Published

Sports competition engine: brackets, leagues, groups, two-legged ties, best-of-N series, play-in, divisional schedules, draft lottery, rolling rankings, Elo.

Downloads

431

Readme

@taipeistudio/gamekit-competition

npm license

Sports competition engine as plain, save-friendly data.

Installation

npm install @taipeistudio/gamekit-competition

API

  • Knockouts: seedOrder, seedBracket (byes to top seeds), knockout, pairs, playRound(ko, decide, override) (override = the human's match), playOut, champion, exitRound, reached (W/F/SF/QF/R16…), roundLabel, roundCodes.
  • Leagues: roundRobin(teams, { double, rand }) (circle method, balanced home/away, rest days for odd counts), table, record, standings(t, tiebreaks) with points, goal difference, goals for, wins and head-to-head mini-leagues; FOOTBALL_POINTS.
  • Groups: drawGroups(pots, n, rand, conflict) (backtracking, e.g. no same country), groupStage, qualifiers, crossOver (A1 v B2…).
  • League phase (Swiss): swissDraw(pots, rand, { perPot, conflict, attempts }) — the 2024+ Champions League draw: perPot opponents from every pot (own included), half at home, no repeats or conflicts, laid out as perPot * pots.length matchdays where everyone plays once. Pots must be equal size; throws if no draw is found. Rank it with table().
  • Pyramids: promoteRelegate(tiers, moves) (a count per boundary, sizes preserved; new tier = survivors, then promoted-in, then relegated-in), allocate(order, slots) (split a final table into { cl, el, down… }).
  • Results: expected/eloUpdate/eloWinner, poisson, scoreline (football-like scores from two ratings, home edge), twoLegs (aggregate, then your decider), penalties.
  • Series and play-in: series(a, b, bestOf, pattern) (default 2-2-1-1-1 home court for a; HOME_2_3_2), nextGame, recordGame, playSeries(s, play), seriesWinner, seriesLoser, seriesStatus ("A lead 3-1"), playIn([s7, s8, s9, s10], play). Use playSeries as the decide of playRound for a playoff bracket.
  • Divisional schedules: planDivisional(shape, counts, rand) (pair counts; NBA_COUNTS gives 82 games for 2 x 3 x 5 teams), gamesPerTeam, expandMatchups (balanced home and away), scheduleDays(fixtures, rand, { days, noThreeInThree, load }) (one list per day, no doubles, even spread), backToBacks. Win-loss tables: table(teams, WIN_LOSS), winPct, gamesBehind, winLoss.
  • Drafts: draftLottery(worstFirst, rand, odds, drawn) (NBA_LOTTERY_ODDS, weighted draws without replacement, reports jumps), draftOrder(firstRound, rounds, laterRounds, owner) (traded picks), runDraft(picks, board, pick).
  • High scores: highScore(rand, ra, rb, { avgPoints, spread, perPoint, homeEdge, overtime }) returns [a, b, overtimes], never tied (basketball, handball).
  • Rankings: rank(entries, now, { window, best, include }) (rolling best-N, e.g. 52 weeks / best 10), prune, memoRanking, TOUR_SHARES (points/prize by round).

See the football career example in the gamekit README.

License

MIT with attribution. Part of gamekit. Copyright © 2026 Rosdyana Kusuma. See LICENSE; products using this package must credit the author (e.g. "gamekit by Rosdyana Kusuma - https://github.com/rosdyana/gamekit").