Skip to content

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

License

Notifications You must be signed in to change notification settings

Scorpibear/fen-analyzer

Repository files navigation

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'

About

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

Topics

Resources

License

Stars

Watchers

Forks

Packages