JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q14214F
  • License MIT

Package Exports

  • @flynnhillier/chessboard-image-gen
  • @flynnhillier/chessboard-image-gen/dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@flynnhillier/chessboard-image-gen) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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
  • Styles of pieces
  • Orientation of board

Usage

Load FEN

import { ChessImageGenerator } from "./ChessImageGenerator";

async function main() {
  await ChessImageGenerator.fromFEN(
    "rnbqkbnr/1ppppQpp/8/8/2B5/p3P3/PPPP1PPP/RNB1K1NR b KQkq - 0 4",
    "./output.png"
  );
}

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