Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ebemunk/node-uci
UCI Protocol for node.js - talk to chess engines painlessly
https://github.com/ebemunk/node-uci
chess chess-engine uci
Last synced: about 1 month ago
JSON representation
UCI Protocol for node.js - talk to chess engines painlessly
- Host: GitHub
- URL: https://github.com/ebemunk/node-uci
- Owner: ebemunk
- License: mit
- Created: 2016-06-15T04:41:05.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2022-02-15T00:00:28.000Z (almost 3 years ago)
- Last Synced: 2024-04-13T21:57:42.392Z (9 months ago)
- Topics: chess, chess-engine, uci
- Language: JavaScript
- Homepage: https://ebemunk.github.io/node-uci/
- Size: 1.65 MB
- Stars: 46
- Watchers: 2
- Forks: 14
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# node-uci
node-uci is an implementation of the [Universal Chess Interface](http://www.shredderchess.com/chess-info/features/uci-universal-chess-interface.html) protocol for node.js. In short, you can talk to engines (like Stockfish, Rybka, etc.) from node.js without any headaches. Abstracts away the pesky communication and parsing of UCI and provides a sane API to communicate with engines.
[![Build Status](https://travis-ci.org/ebemunk/node-uci.svg?branch=master)](https://travis-ci.org/ebemunk/node-uci)
[![Code Climate](https://codeclimate.com/github/ebemunk/node-uci/badges/gpa.svg)](https://codeclimate.com/github/ebemunk/node-uci)
[![Test Coverage](https://codeclimate.com/github/ebemunk/node-uci/badges/coverage.svg)](https://codeclimate.com/github/ebemunk/node-uci/coverage)## Install
Through npm with `npm install node-uci`.
## Usage / Docs
[Usage examples and documentation](https://ebemunk.github.io/node-uci/)
## TLDR;
```javascript
import { Engine } from 'node-uci'
// or
const Engine = require('node-uci').Engine// async/await
const engine = new Engine('engine/executable/path')
await engine.init()
await engine.setoption('MultiPV', '4')
await engine.isready()
console.log('engine ready', engine.id, engine.options)
const result = await engine.go({ nodes: 2500000 })
console.log('result', result)
await engine.quit()//promises with chain
const engine = new Engine('engine/executable/path')
engine
.chain()
.init()
.setoption('MultiPV', 3)
.position('r1bqkbnr/pppp1ppp/2n5/1B2p3/4P3/5N2/PPPP1PPP/RNBQK2R b KQkq - 3 3')
.go({ depth: 15 })
.then(result => {
console.log(result)
})
```## License
MIT
## Contribute
PRs always welcome