Is there a way to get MANY and FAST (but not deep) position evaluations in javascript? I am working on a statistical chess project that needs to evaluate many (about 20-30) different positions per turn. They do not need to be deep but fast.

Is there a possibility to use engines (stockfish is preferred because I am familiar with its evaluation system) that receives a fen as an input and gives me a fast evaluation of the position (probably with a given deepness, e.g 10) as output.

It should run in a web browser. So I assume the official Stockfish is not suitable, because it is written in C++.

I found this and this, but there is no hint how to use them, so I would appreciate for some hints if I should use them. Does somebody has experience with this implementations? Could you advise me something else?
Stockfish JS is a Javascript port of the Stockfish engine. It should be useful for your project. You might want to learn the UCI protocol.

Hint:

Use Stockfish JS. Consider:


Send MultiPV for a position. You will get an evaluation for the moves.


OR 


For n legal moves, play them one by one. Ask Stockfish for an evaluation on each of those possibilities.


The second approach is slower but more accurate. If you just want shallow search, try the first one.

If you could multithread, do it. If you could run positions independently, do it.