npm

Need private packages and team management tools?Check out npm Orgs. »

fen-analyzer

0.3.1 • Public • Published

fen-analyzer

Build Status Coverage Status npm version

Chess FEN (Forsyth-Edwards Notation) positions analyzer. Having FEN as input helps to identify, e.g. how many pieces left on the board

Example

const fenAnalyzer = require('fen-analyzer');
 
const piecesCount = fenAnalyzer.getPiecesCount('rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1')
 // piecesCount === 32
 
const isBlack = fenAnalyzer.isBlack('rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1') // isBlack === false
 
const fen = 'rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR b KQkq e3 0 1';
fen = fenAnalyzer.normalize(fen);
 // fen === 'rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR b KQkq - 0 1'
 
 
 

install

npm i fen-analyzer

Downloadsweekly downloads

12

version

0.3.1

license

Apache-2.0

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability