chess-eco-codes

FEN to ECO code mappings

Usage no npm install needed!

<script type="module">
  import chessEcoCodes from 'https://cdn.skypack.dev/chess-eco-codes';
</script>

README

chess-eco-codes

Build Status

I grabbed the eco.pgn for pgn-extract and ran it through pgn-parser to generate a lookup table of fen string => opening name, for fast lookup in PGN viewer programs.

Usage

const eco = require('chess-eco-codes');

const data = eco('rnbqkbnr/pppppppp/8/8/6P1/8/PPPPPP1P/RNBQKBNR b KQkq g3 0 1');
console.log(data);

Output

The result from the console log above would be

{
    "code": "A00",
    "name": "Grob's Attack",
    "moves": "1. g4"
}

Run tests


npm install
npm test