0.1.10 • Published 4 years ago

chess-pgn v0.1.10

Weekly downloads
12
License
MIT
Repository
github
Last release
4 years ago

chess-pgn

chess-pgn is a library which includes tools for working with Portable Game Notation (PGN).

Installation

npm install chess-pgn

Example usage

const pgn = new Pgn()
    .addTag("Title", "Example pgn")
    .addTag("Description", "Shows how to add tags, moves, variations and comments")
    .move("e4")
    .comment("king's pawn")
    .startingPosition()
    .move("d4")
    .move("Nf6")
    .firstMove()
    .move("d5")
    .selectMove(move => move.name === "e4")
    .move("e5")
    .previousMove()
    .move("c5");

console.log(pgn.toString());
// [Title "Example pgn"]
// [Description "Shows how to add tags, moves, variations and comments"]
//
// 1. e4 {king's pawn} (1. d4 Nf6 (1... d5)) 1... e5 (1... c5) *
0.1.10

4 years ago

0.1.8

4 years ago

0.1.9

4 years ago

0.1.7

4 years ago

0.1.6

4 years ago

0.1.5

4 years ago

0.1.4

4 years ago

0.1.3

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago