# jhlywa/chess.js

A TypeScript chess library for chess move generation/validation, piece placement/movement, and check/checkmate/draw detection

Repository: https://github.com/jhlywa/chess.js
Canonical: https://ross.abutalabs.com/products/chessjs
Homepage: http://jhlywa.github.io/chess.js/
Language: TypeScript
License: BSD-2-Clause
License Family: permissive
Topics: chess
Last push: 2026-08-11T11:07:54+00:00

## Health v2 (maintenance only)
Score: 73/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 97, release rhythm 28, longevity 100
- inputs: {"age_days": 6456, "days_push": 22, "days_rel": 445, "gap_med": 42, "n_releases_24m": 6}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 4388, forks 986 (observed 2026-08-28T04:08:47.189403+00:00)

## What it is
chess.js is a TypeScript chess library providing move generation and validation, piece placement and movement, and check/checkmate/stalemate detection. It is a headless library with no UI, designed to run in Node.js and modern browsers and pair with board-rendering libraries like chessboard.js.

## Use cases
- validate chess moves in a web chess game
- generate legal moves for a chess engine or bot
- detect check, checkmate, and stalemate in an app
- parse and produce PGN and FEN chess notation
- build a chess puzzle or training tool
- play out random or scripted games programmatically

## When to choose
- you need reliable chess rules logic in JavaScript or TypeScript
- you are building a chess UI and need a headless rules engine
- you need PGN/FEN parsing with both permissive and strict modes

## When to avoid
- you need a chess AI or engine evaluation - it explicitly excludes AI
- you need a graphical chessboard or UI components
- you are working outside JavaScript/TypeScript ecosystems

## Facets
- artifact type: library
- maturity: stable
- function: parser, sdk, developer-tools
- domain: gaming-tools, developer-tools
- platform: browser, cross-platform
- tags: chess, game-logic, typescript, move-generation, pgn, fen, board-games, algorithms, nodejs, javascript

## Member repositories
- jhlywa/chess.js (main) score 73

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:08:47.189403+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T18:21:13.862376+00:00, confidence not recorded.
  - readme: https://github.com/jhlywa/chess.js (fetched 2026-08-28T04:08:47.189403+00:00, sha 3708eaa5d6e3)
  - homepage: http://jhlywa.github.io/chess.js/ (fetched 2026-08-29T09:09:30.446085+00:00, sha 8a7e59d14201)
  - registry_npm: https://registry.npmjs.org/chess.js (fetched 2026-08-29T09:09:30.455973+00:00, sha 74eb9dbb1c5c)
- Data as of 2026-08-30T08:39:29.467469+00:00.
