0.1.13 • Published 9 months ago

@flynnhillier/chessboard-image-gen v0.1.13

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

Chessboard image generator

Generate PNG images of chessboard positions, based on specified chess notation.

Chess notation currently supported:

  • FEN

Configure outputted image with a selection of configuration options:

  • Size of image
  • Colour of board
  • Orientation of board

Installation

Using your preffered package manager:

pnpm: pnpm install @flynnhillier/chessboard-image-gen

npm: npm i @flynnhillier/chessboard-image-gen

Usage

Load FEN

import { ChessBoardImage } from "@flynnhillier/chessboard-image-gen";

//Wrap in an asyncrinous function so we can call within our top level.
async function main() {
  const ci = new ChessBoardImage();
  await ci.fromFEN(
    "rnbqkbnr/2pppQpp/8/1p6/2B1PP2/p7/PPPP2PP/RNB1K1NR b KQkq - 0 6",
    "myChessBoardImage"
  );
}

main();

Inspiration

This repo is based off of @andyruwruw's package chess-image-generator . I have rewritten aspects of it, as the package no longer seems to be maintained and I had issues installing the package in a typescript ecosystem.

Example output

example

0.1.11

9 months ago

0.1.12

9 months ago

0.1.13

9 months ago

0.1.1

9 months ago

0.0.52

1 year ago

0.0.51

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago