- Consumers install prebuilt binaries from npm.
- Maintainers compile native code explicitly.
uiohookis vendored directly in this repository.
- Node.js 20, 22, or 24
pnpm10+- CMake 3.15+
- Python 3
- Windows: Visual Studio 2022 with Desktop development with C++
- Linux: X11 development headers required by the root
CMakeLists.txt - macOS: Xcode command line tools
Windows note: the native build is no longer based on node-gyp. We use cmake-js, but Visual Studio 2022 is still the supported compiler baseline for maintainers.
Linux packages currently required by the vendored uiohook build:
cmakegccgcc-c++makeninja-buildlibX11-devellibXrandr-devellibXt-devellibXtst-devellibxkbcommon-devellibxkbcommon-x11-devellibxkbfile-devel
Fedora / WSL example:
sudo dnf install -y \
nodejs npm cmake gcc gcc-c++ make ninja-build \
libX11-devel libXrandr-devel libXt-devel libXtst-devel \
libxkbcommon-devel libxkbcommon-x11-devel libxkbfile-devel
sudo npm install -g pnpm@10.25.0pnpm install --ignore-scripts
pnpm devDirect build commands:
node ./scripts/build.mjs
node ./scripts/prebuild.mjspnpm dev prints keydown, keypress, and keyup events as you press keys.
Press Esc to stop the process.
src/: TypeScript API surfacesrc/lib/: N-API glue codeuiohook/: vendored upstream native library sourcesCMakeLists.txt: root native build entrypointprebuilds/: distributable native binaries
- Do not reintroduce git submodules for
uiohook. - Do not keep local changes in patch files.
- Keep install-time compilation out of the consumer path.
- Do not reintroduce
binding.gyp/node-gypinto the main build path.