# chesssk

> Chess move validation library based on board data

Latest version **1.2.3** (published 2020-10-07) · GPL-3.0-or-later license · 0 weekly downloads

## Install

```sh
npm install chesssk
pnpm add chesssk
yarn add chesssk
bun add chesssk
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.3 |
| Published | 2020-10-07 |
| First published | 2020-09-04 |
| Weekly downloads | 0 |
| License | GPL-3.0-or-later |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 78 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Shane Koehler |
| Maintainers | shmoesolid |
| Keywords | chess |

## Links

- npm: https://www.npmjs.com/package/chesssk
- Repository: https://github.com/shmoesolid/CheSSsk
- Homepage: https://github.com/shmoesolid/CheSSsk#readme
- Issues: https://github.com/shmoesolid/CheSSsk/issues
- npm.io page: https://npm.io/package/chesssk

## Recent versions

- 1.2.3 (latest) — 2020-10-07
- 1.2.2 — 2020-10-07
- 1.2.1 — 2020-10-07
- 1.2.0 — 2020-10-07
- 1.1.91 — 2020-10-07
- 1.1.9 — 2020-10-07
- 1.1.8 — 2020-10-06
- 1.1.71 — 2020-10-05
- 1.1.7 — 2020-10-05
- 1.1.6 — 2020-10-03
- 1.1.5 — 2020-10-02
- 1.1.4 — 2020-10-02
- 1.1.3 — 2020-10-02
- 1.1.2 — 2020-10-02
- 1.1.1 — 2020-10-02
- … 13 more at https://npm.io/package/chesssk/versions

## README

# CheSSsk Library

## Description

*Still a WIP*

A library for chess move validation based on location and board data.

* Set up new game
* Load game from database JSON string
* Export board data to JSON string for saving
* Get valid moves for pieces based on location
* Make only valid moves for pieces
* En passant
* King check and checkmate status updates
* Pawn exchange

## Example Usage

- Creating a new game and getting valid moves for a location

    ```javascript
    const chesssk = require("chesssk");
    const game = new chesssk();

    game.setupNewGame();

    let validMoves = game.getValidMoves("b1");
    console.log(validMoves);
    ```

- Load a game from database, make a move, and get new grid data in json string

    ```javascript
    const chesssk = require("chesssk");
    const game = new chesssk();

    game.setGridFromJSON( db.jsonGameData );

    let moveResult = game.move("b2", "b4", db.enPassantString);
    let dbJsonStringToSave = game.getGridInJSON();

    // do database and client updates with moveResult object and new grid data
    console.log(moveResult, dbJsonStringToSave);
    ```

---
_Source: https://npm.io/package/chesssk · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
