Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Chess
  3. chess.js

chess.js

BSD-2-ClauseTypeScriptv1.4.0

A TypeScript chess library for move generation, validation, and game state detection.

Visit WebsiteGitHubGitHub
4.4k stars984 forks0 contributors

What is chess.js?

chess.js is a TypeScript library that implements core chess logic, including move generation, validation, piece movement, and detection of game states like check, checkmate, and stalemate. It provides everything needed to build chess applications except for AI components.

Target Audience

Developers building chess applications, such as game engines, analysis tools, or educational software, who need reliable chess logic without implementing the rules from scratch.

Value Proposition

It offers a well-tested, lightweight, and easy-to-integrate solution for chess logic, saving developers time and ensuring rule accuracy across both Node.js and browser environments.

Overview

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

Use Cases

Best For

  • Building chess game engines without AI
  • Creating chess analysis or training tools
  • Developing educational chess applications
  • Implementing chess logic for web or mobile apps
  • Adding PGN support to chess projects
  • Prototyping chess-related software quickly

Not Ideal For

  • Developers needing built-in chess AI or engine analysis out of the box
  • Projects requiring graphical chess boards or UI components without additional libraries
  • Applications that depend on non-standard chess variants like Chess960 or custom rules

Pros & Cons

Pros

Robust Move Generation

Generates all legal moves for any board position, ensuring accurate gameplay logic as demonstrated in the example code for random move selection.

Comprehensive Game State

Detects check, checkmate, stalemate, and draws reliably, core to its design for handling chess rules without AI.

PGN Support

Provides built-in PGN output via chess.pgn(), facilitating easy game recording and sharing for analysis tools.

Well-Tested Portability

Extensively tested in Node.js and modern browsers, making it a dependable choice for cross-environment applications.

Cons

No AI Capabilities

Explicitly omits chess AI, requiring developers to implement or integrate separate engines for intelligent gameplay, as stated in the README.

Limited to Standard Rules

Focused on traditional chess, lacking support for variants without modification, which can restrict flexibility for innovative projects.

Minimal UI Integration

Provides no graphical components, necessitating additional libraries like chessboard.js for board visualization and user interaction.

Frequently Asked Questions

Quick Stats

Stars4,399
Forks984
Contributors0
Open Issues25
Last commit28 days ago
CreatedSince 2008

Tags

#game-library#validation#move-generation#nodejs#typescript#chess#board-game#browser#pgn

Built With

T
TypeScript

Links & Resources

Website

Included in

Chess495
Auto-fetched 8 hours ago

Related Projects

npm chess packagenpm chess package

An algebraic notation driven chess engine that can validate board position and produce a list of viable moves

Stars0
Forks0
Last commit
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub