awesome-repositories.com
Blog
MCP
awesome-repositories.com

Discover the best open-source repositories with AI-powered search.

ExploreCurated searchesOpen-source alternativesSelf-hosted softwareBlogSitemap
ProjectMCP serverAboutHow we rankPress
LegalPrivacyTerms
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
jhlywa avatar

jhlywa/chess.js

0
View on GitHub↗
4,257 stars·977 forks·TypeScript·bsd-2-clause·22 viewsjhlywa.github.io/chess.js↗

Chess.js

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.

Features

  • Chess Board State Managers - Ships a headless chess board state manager that tracks piece placements and game conditions.
  • Chess Game Engines - An engine that enforces official chess rules, generates legal moves, and tracks game state without a user interface.
  • Stalemate Detectors - Reports whether the side to move has been stalemated.
  • Threefold Repetition Detectors - Implements threefold repetition detection as a standard draw condition in chess.
  • ASCII Board Renderers - Generates text-based visual representations of the board for debugging and display.
  • Board State Queries - Ships multiple methods to query the board state in array, diagram, and FEN formats.
  • Board State Manipulators - Provides utilities for manually altering piece placements and board configurations.
  • Board Reset Utilities - Provides a function to reset the board to the standard starting position.
  • Piece Placement Modifiers - Provides validated piece placement on individual squares for board setup.
  • Piece Removal Utilities - Provides piece removal from individual squares for board manipulation.
  • Castling Rights Managers - Provides configuration of castling rights for each color in the chess game.
  • Check and Checkmate Detectors - Detects check and checkmate conditions for the side to move in the chess game.
  • Chess Game Logic Engines - Implements detection of check, checkmate, stalemate, and draw conditions for chess analysis.
  • Chess Move Validation Libraries - Verifies the legality of chess moves according to official game rules.
  • Chess Notation Parsers - Parses and generates standard chess notations like FEN and PGN for game records.
  • Game End State Detectors - Implements rule-based detection of draw conditions including the fifty-move rule and insufficient material.
  • Game Notation Export - Load a board state from a FEN string or PGN notation, and export the current game as FEN or PGN.
  • Legal Move Generators - Generates all legal chess moves by applying piece-specific patterns and filtering against check constraints.
  • Move Execution Systems - Provides move execution systems that apply legal chess moves to the board state.
  • Move History Stacks - Maintains a stack of move objects enabling undo of the last half-move to explore alternative variations.
  • Move History Tracking - Records a chronological sequence of moves to enable state restoration and game review.
  • Move Reversion Systems - Ships move reversion systems to undo game moves and restore previous board states.
  • Move Validation Engines - Validates moves in Standard Algebraic Notation and executes them if legal.
  • FEN Configuration Parsers - Encodes and decodes complete board configurations using Forsyth-Edwards Notation strings.
  • FEN Managers - Initialize, load, or export board positions using Forsyth-Edwards Notation (FEN) strings, with optional validation skipping.
  • PGN Notation Managers - Stores and retrieves move sequences and metadata using the Portable Game Notation format.
  • Piece Position Querying - Provides utilities for retrieving piece locations and identifying which piece occupies a given square.
  • Piece Placement Modifiers - Provides validated piece placement and removal on individual squares for board setup.
  • Piece Placement Validators - Provides validated piece placement on squares, enforcing rules like preventing duplicate kings.
  • Piece Removal Utilities - Provides piece removal from individual squares for board manipulation.
  • Position Setup Utilities - Provides initialization of board positions from FEN strings and manual piece placement.
  • Square Control Analyzers - Provides algorithms to determine which pieces attack or control specific squares on the board.
  • Check and Checkmate Status Detectors - Reports check, checkmate, and stalemate status for the current player.
  • Stalemate and Repetition Detectors - Detects stalemate and threefold repetition, key draw conditions in chess.
  • Board Array Representations - Provides a method to retrieve the board as a two-dimensional array for programmatic access.
  • Board Reset Utilities - Provides a function to reset the board to the standard starting position.
  • FEN Position Loaders - Set up the board from a FEN string, resetting castling rights, en passant square, and move counters.
  • Board Notation Validation - Parse a Forsyth-Edwards Notation string and return whether the board setup is valid or list any errors found.
  • Move Notation Parsing - Parses Standard Algebraic Notation and variants into structured move objects for execution.
  • Stalemate Status Detectors - Returns whether the side to move has been stalemated.
  • Board State Visualizers - Displays board configurations using text-based diagrams and standard notation.
  • Board State Inspectors - Returns board state in multiple formats and detects check, checkmate, and draw conditions.
  • Board State Inspectors - Retrieves pieces, square colors, castling rights, and 2D array representations of the board.
  • Turn Managers - Manages which side moves next, enforcing turn-based play rules.
  • Board Position Hashing - Generates unique 64-bit hashes for board positions to enable rapid comparison and repetition detection.
  • Position Hashing - Computes unique 64-bit hashes for board positions to enable fast repetition detection and comparison.
  • Type-Safe Game State Definitions - Uses TypeScript's type system to enforce chess-specific invariants like move structures and piece types.

Star history

Star history chart for jhlywa/chess.jsStar history chart for jhlywa/chess.js

How this analysis was created: This summary and feature list are AI-generated from collected project material and can contain mistakes. Stars, license and language are imported from GitHub. Inclusion does not mean that we have tested or audited this project. Check the source documentation for any feature you depend on. Learn more on our About page.

AI search

Explore more awesome repositories

Describe what you need in plain English — the AI ranks thousands of curated open-source projects by relevance.

Start searching with AI

Projects sharing features with Chess.js

These projects share indexed features with Chess.js. Shared tags can include platform or build tooling; verify the primary use case before treating a result as a replacement.
  • tensorflow/minigotensorflow avatar

    tensorflow/minigo

    3,531View on GitHub↗

    Minigo is a TensorFlow-based reinforcement learning engine designed to master the game of Go. It functions as a comprehensive system for training neural networks to predict board policies and game outcomes, utilizing a model trainer to generate self-play data and optimize weights. The project is distinguished by its ability to perform large-scale game simulations using Kubernetes to distribute worker nodes across CPU, GPU, and TPU hardware. It employs a Monte Carlo Tree Search implementation to identify optimal moves and supports specialized hardware acceleration, including inference on Edge

    C++
    View on GitHub↗3,531
  • leelachesszero/lc0LeelaChessZero avatar

    LeelaChessZero/lc0

    2,991View on GitHub↗

    Leela Chess Zero is a deep learning game AI and neural network chess engine that uses search algorithms to determine optimal moves and evaluate game states. It functions as a UCI chess engine, implementing the Universal Chess Interface standard for compatibility with various graphical user interfaces. The system acts as a hardware-accelerated move calculator, leveraging GPU and CPU backends to accelerate neural network inference. It supports the generation and submission of self-play games to training clients to improve the strength of its neural network models. The engine provides capabilit

    C++alphazeroalphazero-inspiredchess
    View on GitHub↗2,991
  • nethack/nethackNetHack avatar

    NetHack/NetHack

    3,490View on GitHub↗

    NetHack is a roguelike dungeon crawler and ASCII-based role playing game. It is a turn-based adventure game featuring permanent character death and the exploration of randomly generated dungeons. The project serves as a cross-platform game engine designed to be compiled and run across diverse operating systems and hardware architectures. It focuses on retro game preservation by maintaining classic game logic for modern computing environments. The codebase implements procedural content generation for maps and encounters and utilizes a grid-based coordinate system for spatial tracking. Renderi

    Ccgameroguelike
    View on GitHub↗3,490
  • official-stockfish/stockfishofficial-stockfish avatar

    official-stockfish/Stockfish

    14,802View on GitHub↗

    Stockfish is a high-performance chess engine designed to evaluate board positions and calculate optimal moves. It functions as a command-line tool that utilizes neural network-based search algorithms to assess complex game states and determine strategic advantages. The engine is fully compliant with the Universal Chess Interface, allowing it to exchange commands and move data with external graphical user interfaces and professional analysis software. The engine distinguishes itself through advanced computational strategies that maximize hardware efficiency and search depth. It employs multi-t

    C++chesschess-enginecpp
    View on GitHub↗14,802

Frequently asked questions

What does jhlywa/chess.js do?

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.

What are the main features of jhlywa/chess.js?

The main features of jhlywa/chess.js are: Chess Board State Managers, Chess Game Engines, Stalemate Detectors, Threefold Repetition Detectors, ASCII Board Renderers, Board State Queries, Board State Manipulators, Board Reset Utilities.

Which projects share features with jhlywa/chess.js?

Projects with overlapping indexed features include: tensorflow/minigo — Minigo is a TensorFlow-based reinforcement learning engine designed to master the game of Go. It functions as a… leelachesszero/lc0 — Leela Chess Zero is a deep learning game AI and neural network chess engine that uses search algorithms to determine… nethack/nethack — NetHack is a roguelike dungeon crawler and ASCII-based role playing game. It is a turn-based adventure game featuring… official-stockfish/stockfish — Stockfish is a high-performance chess engine designed to evaluate board positions and calculate optimal moves. It…