{"id":45279393,"url":"https://github.com/mormubis/elo","last_synced_at":"2026-02-21T02:17:52.942Z","repository":{"id":65572031,"uuid":"585409553","full_name":"mormubis/elo","owner":"mormubis","description":"ELO is part of the ECHECS project, providing an implementation of the ELO Rating System following FIDE rules","archived":false,"fork":false,"pushed_at":"2026-02-19T22:15:14.000Z","size":976,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-20T02:20:22.014Z","etag":null,"topics":["chess","elo","fide","matchmaking","pvp","rank","ranking","rating","score","scoring"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@echecs/elo","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mormubis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":["mormubis"]}},"created_at":"2023-01-05T05:06:15.000Z","updated_at":"2026-02-19T22:15:18.000Z","dependencies_parsed_at":"2024-09-15T08:28:27.577Z","dependency_job_id":"d03b72c7-05f8-4d18-83b1-12d93980e472","html_url":"https://github.com/mormubis/elo","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/mormubis/elo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mormubis%2Felo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mormubis%2Felo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mormubis%2Felo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mormubis%2Felo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mormubis","download_url":"https://codeload.github.com/mormubis/elo/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mormubis%2Felo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29668639,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-20T23:24:07.480Z","status":"ssl_error","status_checked_at":"2026-02-20T23:24:06.202Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chess","elo","fide","matchmaking","pvp","rank","ranking","rating","score","scoring"],"created_at":"2026-02-21T02:17:52.405Z","updated_at":"2026-02-21T02:17:52.928Z","avatar_url":"https://github.com/mormubis.png","language":"TypeScript","funding_links":["https://github.com/sponsors/mormubis"],"categories":[],"sub_categories":[],"readme":"# ELO\n\n[![npm](https://img.shields.io/npm/v/@echecs/elo)](https://www.npmjs.com/package/@echecs/elo)\n[![Test](https://github.com/mormubis/elo/actions/workflows/test.yml/badge.svg)](https://github.com/mormubis/elo/actions/workflows/test.yml)\n[![Coverage](https://codecov.io/gh/mormubis/elo/branch/main/graph/badge.svg)](https://codecov.io/gh/mormubis/elo)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)\n[![API Docs](https://img.shields.io/badge/API-docs-blue.svg)](https://mormubis.github.io/elo/)\n\n**ELO** is a small TypeScript library for calculating\n[Elo ratings](https://en.wikipedia.org/wiki/Elo_rating_system) — the system used\nin chess and many other competitive games to measure relative skill.\n\nIt follows [FIDE rules](https://handbook.fide.com/chapter/B022024) out of the\nbox: K-factors by age, games played, and rating tier; a 400-point rating\ndifference cap; and performance rating calculation. Zero runtime dependencies.\n\n## Why this library?\n\nMost Elo libraries on npm give you the basic formula and nothing else. If you're\nbuilding a chess platform or any app that follows FIDE rules, you'd have to\nimplement the rest yourself. This library ships it all out of the box:\n\n- **FIDE K-factor rules** — K=40 for new players (≤ 30 games) and juniors (age \u003c\n  18, rating \u003c 2300), K=10 for players who have ever reached 2400, K=20 for\n  everyone else. No configuration needed.\n- **Game type awareness** — blitz and rapid games always use K=20, regardless of\n  rating or experience, matching FIDE §B02.\n- **400-point rating difference cap** — rating differences above 400 are clamped\n  before calculating win probability, as required by FIDE §8.3.1. Most libraries\n  skip this.\n- **Performance rating** — calculates a player's FIDE performance rating\n  (§8.2.3) over a series of games. No other Elo library on npm implements this.\n\nIf you don't need FIDE compliance, any Elo library will do. If you do, this is\nthe one.\n\n## Installation\n\n```bash\nnpm install @echecs/elo\n```\n\n## Quick Start\n\n```typescript\nimport { update } from '@echecs/elo';\n\n// Two players both rated 1400. Player A wins.\nconst [playerA, playerB] = update(1400, 1400, 1);\n\nconsole.log(playerA); // 1410\nconsole.log(playerB); // 1390\n```\n\n## Usage\n\n**Basic** — when you just need new ratings after a game:\n\n```typescript\nimport { update } from '@echecs/elo';\n\nconst [newRatingA, newRatingB] = update(1400, 1400, 1); // → [1410, 1390]\n```\n\n**Player options** — pass a player object when you need to apply FIDE K-factor\nrules for age or experience:\n\n```typescript\nimport { update } from '@echecs/elo';\n\n// Young player (age \u003c 18, rating \u003c 2300) gets K=40\nconst [newRatingA, newRatingB] = update({ age: 15, rating: 1400 }, 1400, 1); // → [1420, 1390]\n\n// New player (≤ 30 games played) also gets K=40\nconst [newRatingC, newRatingD] = update(\n  { gamesPlayed: 10, rating: 1400 },\n  1400,\n  1,\n); // → [1420, 1390]\n```\n\n**Game options** — pass a game object as the third argument when the game type\naffects the K-factor:\n\n```typescript\nimport { update } from '@echecs/elo';\n\n// Blitz and rapid games always use K=20\nconst [newRatingA, newRatingB] = update(2400, 2400, {\n  gameType: 'blitz',\n  result: 1,\n}); // → [2410, 2390]\n```\n\n**Performance rating** — use `performance()` to calculate a player's FIDE\nperformance rating over a tournament:\n\n```typescript\nimport { performance } from '@echecs/elo';\n\nconst rating = performance([\n  { opponentRating: 1600, result: 1 },\n  { opponentRating: 1600, result: 0.5 },\n  { opponentRating: 1600, result: 0 },\n]); // 1600\n```\n\n## API\n\nFull API reference is available at https://mormubis.github.io/elo/\n\n## Contributing\n\nContributions are welcome. Please read [CONTRIBUTING.md](CONTRIBUTING.md) for\nguidelines on how to submit issues and pull requests.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmormubis%2Felo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmormubis%2Felo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmormubis%2Felo/lists"}