Skip to content

Repository files navigation

node-uci

node-uci is an implementation of the Universal Chess Interface 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 StatusCode ClimateTest Coverage

Install

Through npm with npm install node-uci.

Usage / Docs

Usage examples and documentation

TLDR;

import{Engine}from'node-uci'// orconstEngine=require('node-uci').Engine// async/awaitconstengine=newEngine('engine/executable/path')awaitengine.init()awaitengine.setoption('MultiPV','4')awaitengine.isready()console.log('engine ready',engine.id,engine.options)constresult=awaitengine.go({nodes: 2500000})console.log('result',result)awaitengine.quit()//promises with chainconstengine=newEngine('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

About

UCI Protocol for node.js - talk to chess engines painlessly

Topics

Resources

Stars

49 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages