Releases: chessviewer-org/chess-viewer-utils
Releases · chessviewer-org/chess-viewer-utils
Release list
v1.2.0
v1.1.0
v1.0.0 — Initial release
First public release of @chessvision-org/chess-vision — a dependency-free chess diagram toolkit for Node.js and the browser. No DOM, no network, no CDN.
Highlights
- FEN — parse to an 8×8 matrix, validate (quick + detailed), and parse/serialize the full six-field record (board, side to move, castling, en passant, clocks).
- Board manipulation — pure, immutable helpers: place / move / remove pieces, flip, list & count pieces, material balance, king lookup, legality check. Squares accept
'e4'or[row, col]. - SVG diagrams —
generateDiagram()renders a self-contained SVG with the inline CBurnett/Lichess piece set, coordinates, board flip, custom colors, optional frame, and an accessiblearia-label. - Themes & presets — 20 board themes, 23 piece sets, print/social quality presets, plus contrast-aware lookup helpers.
- Color — hex/RGB/HSV conversion and WCAG 2.1 luminance/contrast utilities.
- Images — read PNG/JPEG pixel dimensions from the header (no decode) and rewrite PNG
pHYs/ JPEG JFIF DPI metadata; compute physical print sizes. - Plus — coordinate math, history utilities, and input sanitization.
Quality
- Full TypeScript types shipped — no
@types/…needed. - Dual ESM + CJS build.
- 107 unit tests (Node.js native test runner), all passing.
Install
npm install @chessvision-org/chess-visionimport { generateDiagram } from '@chessvision-org/chess-vision';
const svg = generateDiagram({
fen: 'rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1',
size: 400,
showCoords: true,
});See the README for the full API reference and the CHANGELOG for details.
Requirements: Node.js ≥ 18, or any modern browser.