npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@loloof64/react-native-stockfish

v0.2.0

Published

Use stockfish chess engine in your React Native application

Downloads

132

Readme

@loloof64/react-native-stockfish

Use stockfish chess engine in your React Native application.

Installation

npm install @loloof64/react-native-stockfish

Usage

import {
  stockfishLoop,
  sendCommandToStockfish,
  subscribeToStockfishOutput,
  subscribeToStockfishError,
  stopStockfish,
} from '@loloof64/react-native-stockfish';

// ...

stockfishLoop();

// ...

useEffect(() => {
  const unsubscribe = subscribeToStockfishOutput((output) => {
    console.log('Stockfish Output:', output);
  });

  return () => unsubscribe();
}, []);

useEffect(() => {
  const unsubscribe = subscribeToStockfishError((error) => {
    console.log('Stockfish Error:', error);
  });

  return () => unsubscribe();
}, []);

// ...

sendCommandToStockfish('go movetime 1000');

// ...

stopStockfish();

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

Changing Stockfish source files

If you need to upgrade Stockfish source files, create a folder stockfish inside cpp folder, copy the src folder from the stockfish sources into the new stockfish folder. Also you need to make some more adaptive works :

Adapting streams

  • copy the cpp/fixes folder inside the cpp/stockfish folder

  • replace all calls to cout << #SomeContent# << endl by fakeout << #SomeContent# << fakeendl (And ajust also calls to cout.rdbuf() by fakeout.rdbuf()) But do not replace calls to sync_cout.

  • copy folder cpp/fixes inside the stockfish folder

  • add include to ../fixes/fixes.h in all related files (and adjust the include path accordingly)

  • proceed accordingly for cin : replace by fakein

  • and the same for cerr: replace by fakeerr

  • in misc.h replace

#define sync_cout std::cout << IO_LOCK
#define sync_endl std::endl << IO_UNLOCK

with

#define sync_cout fakeout << IO_LOCK
#define sync_endl fakeendl << IO_UNLOCK

and include ../../fixes/fixes.h

Adapting NNUE

In file CMakeLists.txt replace the names of big and small NNUE by the ones you can find in file cpp/stockfish/src/evaluate.h. Also replace those values in the file loloof64-react-native-stockfish.podspec.

License

MIT


Made with create-react-native-library

Credits

Using sources of Stockfish 17.