Skip to content

chess-core

A fast, type-safe chess library with immutable state and bitboard representation.
Terminal window
npm install @pech/chess-core
# or
bun add @pech/chess-core
import { fromFen, fromSan, makeMove, toSan, isCheckmate, STARTING_FEN } from '@pech/chess-core';
const pos = fromFen(STARTING_FEN);
const move = fromSan(pos, 'e4');
const newPos = makeMove(pos, move);
console.log(toSan(pos, move)); // "e4"
console.log(isCheckmate(newPos)); // false