chesster
v1.1.0
Published
Parser for chess.com API
Downloads
15
Maintainers
Readme
Introduction
Parser for chess.com API
Code Samples
Initialize Chesster instance
const chess = new Chesster("123456789"); // Pass in the game id for e.g: https://www.chess.com/game/live/123456789
await chess.initialize(); // Initialize chess instance to retrieve game data
Example of use
const fen = await chess.getFen();
List of functions
| Functions | Description |
| ------------- | ------------- |
| getFen()
| Fetch fen (A FEN string consists of six fields, separated by spaces. Each field provides specific information about the position) |
| getMoves()
| Fetch moves |
| getPGN()
| Fetch PGN |
| getWinner()
| Fetch winner of the chess game |
| getResultMessage()
| Fetch result message of the chess game |
| getElo()
| Fetch players elo of the chess game |
| getPlayerUsernames()
| Fetch players usernames of the chess game |
| getPlayerData()
| Fetch players data of the chess game (top and bottom side) |
| getAverageElo()
| Fetch average elo of both players |
| getAll()
| Fetch all data (black and white player's elo, their average elo, moves and fens with timestamps, winner and result message and etc) |
Installation
NPM:
npm install chesster
Yarn:
yarn add chesster