chess.js is a headless chess game logic engine and move validation library. It functions as a board state manager that enforces official rules, generates legal moves, and tracks game state without a user interface.
The project provides comprehensive parsing and management for standard chess notations, including PGN for game histories and FEN for board configurations. It includes utilities for importing and exporting game records, managing PGN metadata, and handling position annotations.
The engine covers a wide range of analysis capabilities, such as detecting game-ending conditions like checkmate and stalemate, performing square control analysis, and calculating piece positions. It supports move execution and reversion, move history tracking, and board position hashing for rapid configuration comparison.
The library is implemented in TypeScript.