Jgoboard
jGoBoard Javascript goban (go board) library
Install / Use
/learn @jokkebk/JgoboardREADME
jGoBoard v5
Modular JavaScript toolkit for Go (Baduk/Weiqi): board state, rules engine, variation tree, SGF IO, renderer, and embeddable player.
This package is now v5-first. The legacy v4 API (JGO.Board, JGO.Setup, JGO.Record, etc.) is no longer the primary API surface.
Installation
npm install jgoboard
CDN
Global JGO (UMD):
<script src="https://cdn.jsdelivr.net/npm/jgoboard@5/dist/jgoboard.umd.min.js"></script>
<script>
const game = JGO.createGame({ size: 9 });
</script>
Module import (ESM):
<script type="module">
import { createGame } from 'https://cdn.jsdelivr.net/npm/jgoboard@5/dist/jgoboard.js';
const game = createGame({ size: 9 });
</script>
Quick Start
import { createBoard, STONE, createRenderer } from 'jgoboard';
const board = createBoard({ size: 19 });
board.setStone('D4', STONE.BLACK);
const renderer = createRenderer('#board', {
board,
theme: 'kaya-medium',
});
await renderer.whenReady();
renderer.render();
Module Entry Points
import { createBoard, createGameTree, createCursor } from 'jgoboard';
// or subpaths
import { createGame, rules } from 'jgoboard/core';
import { createRenderer } from 'jgoboard/renderer';
import { kayaMedium } from 'jgoboard/presets';
import { parseSgf, gameTreeFromSgf, sgfFromGameTree } from 'jgoboard/sgf';
import { createPlayer } from 'jgoboard/player';
Documentation
- Renderer API
- Gameplay API
- GameTree + Cursor API
- SGF API
- Player API
- Framework Integration (React, Vue, Svelte)
- Migration: v4 to v5
Demos
demoV5Renderer.htmldemoV5Layers.htmldemoV5Game.htmldemoV5Tree.htmldemoV5Player.html
Run demos in dev mode:
npm install
npm run dev
Then open for example http://localhost:5173/demoV5Player.html.
Development
npm run dev
npm run build
npm run test
npm run lint
npm run format
Build output includes:
dist/jgoboard.js(ESM)dist/jgoboard.cjs(CJS)dist/jgoboard.umd.min.js(UMD)dist/core.{js,cjs},dist/renderer.{js,cjs},dist/presets.{js,cjs},dist/sgf.{js,cjs},dist/player.{js,cjs}dist/*.d.ts
Theme Assets
- Built-in textured themes (
kaya-*,walnut-*) now resolve their image URLs relative to the jGoBoard module/script location. - This works out of the box for direct CDN usage, local repo clone demos, and GitHub release
distusage. - For custom npm/bundler asset layouts, set
assetBaseUrl(globally or per renderer/player instance). bw-*themes do not load image assets.
import { createRenderer, setAssetBaseUrl } from 'jgoboard';
setAssetBaseUrl('/static/vendor/jgoboard/');
// or: createRenderer(target, { board, theme: 'kaya-medium', assetBaseUrl: '/static/vendor/jgoboard/' })
License
Creative Commons Attribution-NonCommercial 4.0 International (CC-BY-NC-4.0).
Related Skills
node-connect
338.0kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
83.4kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
338.0kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
83.4kCommit, push, and open a PR
