@echecs/pgn 3.0.4 → 3.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -10
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -25,7 +25,7 @@ Here’s the structure of the `PGN` object:
|
|
|
25
25
|
|
|
26
26
|
#### PGN Object
|
|
27
27
|
|
|
28
|
-
```
|
|
28
|
+
```typescript
|
|
29
29
|
{
|
|
30
30
|
"meta": Meta,
|
|
31
31
|
"moves": Moves,
|
|
@@ -37,7 +37,7 @@ Here’s the structure of the `PGN` object:
|
|
|
37
37
|
|
|
38
38
|
The `meta` object contains metadata about the chess game.
|
|
39
39
|
|
|
40
|
-
```
|
|
40
|
+
```typescript
|
|
41
41
|
{
|
|
42
42
|
"Event": "name of the tournament or match event",
|
|
43
43
|
"Site": "location of the event",
|
|
@@ -56,12 +56,8 @@ The `meta` object contains metadata about the chess game.
|
|
|
56
56
|
`Moves` is an array representing the sequence of moves in the game. Each element
|
|
57
57
|
is an array containing the move number, the white move, and the black move.
|
|
58
58
|
|
|
59
|
-
```
|
|
60
|
-
[
|
|
61
|
-
moveNumber,
|
|
62
|
-
Move,
|
|
63
|
-
Move
|
|
64
|
-
]
|
|
59
|
+
```typescript
|
|
60
|
+
[moveNumber, Move, Move];
|
|
65
61
|
```
|
|
66
62
|
|
|
67
63
|
Note: Half moves are included for variations or in cases where the last move was
|
|
@@ -71,7 +67,7 @@ made by white.
|
|
|
71
67
|
|
|
72
68
|
Each move is represented by the following structure:
|
|
73
69
|
|
|
74
|
-
```
|
|
70
|
+
```typescript
|
|
75
71
|
{
|
|
76
72
|
"annotations": ["!", "$126"], // optional, annotations for the move
|
|
77
73
|
"capture": false, // optional, indicates if any piece was captured
|
|
@@ -91,7 +87,7 @@ Each move is represented by the following structure:
|
|
|
91
87
|
|
|
92
88
|
Here's a sample usage of the `PGN` parser:
|
|
93
89
|
|
|
94
|
-
```
|
|
90
|
+
```typescript
|
|
95
91
|
import { readFileSync } from 'fs';
|
|
96
92
|
import parse from '@echecs/pgn';
|
|
97
93
|
|
package/package.json
CHANGED