1

I'm currently making a chess web-based app. Now that I want to add in the stockfish chess engine which I will have to interact with in the command line. I've searched the internet and there's the child_process exe related to Node.js. I know how to use it, but only when it is compiled with Node (for example "node file.js" in the command line) but then i don't know how to call that from my main javascript file which contains the chessboard and stuff. Is there a way to do it (if that's even possible) or you may suggest me another way to do it please :D ?

5
  • You can improve your question a bit by adding some env details. What chess engine is? Commented Jan 5, 2021 at 17:26
  • 1
    oh i use stockfish Commented Jan 5, 2021 at 17:27
  • Almost in any way - you should run the child process with exec and read std-out. In perfect condition, you can access the child process using IPC. But it's hard to tell exactly w/o knowing what engine you use. Digg in : nodejs.org/api/… Commented Jan 5, 2021 at 17:29
  • I googled for you like {whatever} npm. Good luck with chess :) Commented Jan 5, 2021 at 17:35
  • 1
    thanks for spending time tho, I think i'll spend some more time on that Commented Jan 5, 2021 at 17:44

1 Answer 1

1

As you using stockfish - It's not necessary to be CLI version.

Here is a pure JavaScript implementation:

https://www.npmjs.com/package/stockfish

Sign up to request clarification or add additional context in comments.

1 Comment

oh maybe this is a better solution for this, thank you

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.