chess2img 0.1.1 → 0.1.2
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 +33 -15
- package/package.json +11 -1
package/README.md
CHANGED
|
@@ -1,8 +1,38 @@
|
|
|
1
1
|
# chess2img
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/chess2img)
|
|
4
|
+
[](https://www.npmjs.com/package/chess2img)
|
|
4
5
|
|
|
5
|
-
`chess2img` renders PNG chess board images from FEN, PGN, or board-array inputs with a small Promise-based API for
|
|
6
|
+
`chess2img` renders PNG chess board images from FEN, PGN, or board-array inputs for Node.js with a small Promise-based API for JavaScript and TypeScript users.
|
|
7
|
+
|
|
8
|
+
## Quick Start
|
|
9
|
+
|
|
10
|
+
Install:
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
npm install chess2img
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Render a board image:
|
|
17
|
+
|
|
18
|
+
```ts
|
|
19
|
+
import { writeFile } from "node:fs/promises";
|
|
20
|
+
import { renderChess } from "chess2img";
|
|
21
|
+
|
|
22
|
+
const png = await renderChess({
|
|
23
|
+
fen: "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1",
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
await writeFile("board.png", png);
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
`renderChess(...)` returns a `Promise<Buffer>` containing PNG data.
|
|
30
|
+
|
|
31
|
+
## Example Output
|
|
32
|
+
|
|
33
|
+
Example board rendered with a built-in theme:
|
|
34
|
+
|
|
35
|
+

|
|
6
36
|
|
|
7
37
|
## Installation
|
|
8
38
|
|
|
@@ -18,18 +48,6 @@ npm install chess2img
|
|
|
18
48
|
|
|
19
49
|
If `canvas` fails to install, verify your system packages first. The library ships `canvas` as a direct dependency, but native prerequisites still need to exist on the host.
|
|
20
50
|
|
|
21
|
-
## Quick Start
|
|
22
|
-
|
|
23
|
-
```ts
|
|
24
|
-
import { renderChess } from "chess2img";
|
|
25
|
-
|
|
26
|
-
const buffer = await renderChess({
|
|
27
|
-
fen: "4k3/8/8/8/8/8/8/4K3 w - - 0 1",
|
|
28
|
-
size: 480,
|
|
29
|
-
style: "merida",
|
|
30
|
-
});
|
|
31
|
-
```
|
|
32
|
-
|
|
33
51
|
## JavaScript Usage
|
|
34
52
|
|
|
35
53
|
```js
|
|
@@ -211,4 +229,4 @@ The library exports:
|
|
|
211
229
|
|
|
212
230
|
## Asset Attribution
|
|
213
231
|
|
|
214
|
-
Bundled built-in themes are derived from the upstream `andyruwruw/chess-image-generator` resource packs and are vendored in-package for deterministic installs. Provenance and licensing notes live in [ATTRIBUTION.md](
|
|
232
|
+
Bundled built-in themes are derived from the upstream `andyruwruw/chess-image-generator` resource packs and are vendored in-package for deterministic installs. Provenance and licensing notes live in [ATTRIBUTION.md](./ATTRIBUTION.md).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "chess2img",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Modern chess board image rendering for Node.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -11,6 +11,16 @@
|
|
|
11
11
|
"url": "https://github.com/ZiriloXXX/chess2img/issues"
|
|
12
12
|
},
|
|
13
13
|
"homepage": "https://github.com/ZiriloXXX/chess2img#readme",
|
|
14
|
+
"keywords": [
|
|
15
|
+
"chess",
|
|
16
|
+
"chessboard",
|
|
17
|
+
"fen",
|
|
18
|
+
"pgn",
|
|
19
|
+
"png",
|
|
20
|
+
"image",
|
|
21
|
+
"chess-image",
|
|
22
|
+
"chess-render"
|
|
23
|
+
],
|
|
14
24
|
"type": "module",
|
|
15
25
|
"main": "./dist/index.cjs",
|
|
16
26
|
"module": "./dist/index.js",
|