nx.js
June 14, 2026 ยท View on GitHub
nx.js is a framework that enables the development of Nintendo Switch homebrew applications using JavaScript. Powered by the V8 JavaScript engine (the same engine as Chrome and Node.js), nx.js provides a streamlined environment for writing homebrew applications for the Nintendo Switch console.
With nx.js, developers can leverage their JavaScript skills and tools to create engaging and interactive experiences for the Nintendo Switch platform. The framework abstracts the underlying low-level details and provides a high-level JavaScript API that simplifies the development process.
nx.js is designed with Web standards in mind, so familiar APIs like
setTimeout(), fetch(), new URL(), Canvas, WebGL2, Web Audio, Web
Bluetooth and much more are supported. If you are familiar with web development
then you should feel right at home.
Features
- JavaScript Development: Write homebrew applications for the Nintendo Switch using JavaScript or TypeScript, a popular and widely supported programming language.
- High-Level API: Benefit from a high-level JavaScript API designed specifically for the Nintendo Switch platform, providing easy access to console-specific features and functionality.
- Input Handling: Capture and process user input with ease, including buttons, touch screen, and motion controls, to create engaging gameplay experiences.
- Graphics and UI: Create visually appealing and interactive user interfaces
using the web
CanvasAPI, GPU-accelerated by the Skia 2D graphics library. - 3D Graphics: Render hardware-accelerated 3D graphics with the
WebGL2API, backed by a real OpenGL ES 3 context on the Switch GPU. - Audio & Video: Play audio and video files with the web
AudioandVideoelements, plus the full Web Audio API, backed by an FFmpeg media pipeline. - Bluetooth: Communicate with Bluetooth Low Energy peripherals using the Web Bluetooth GATT client API.
- WebAssembly: Support for executing code compiled to WebAssembly (WASM).
Getting Started
Please see the Getting Started guide.
Contributing
Contributions to nx.js are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request in the GitHub repository.
Building from Source
Note
nx.js is cross-compiled for the Switch's aarch64 CPU using the
devkitPro toolchain, so a full build can only be
done on a machine with devkitPro installed (Linux, macOS, or WSL). You do
not need to build from source to develop apps โ see the
Getting Started guide, which uses the published
runtime.
- Node.js needs to be installed
(
curl -sfLS install-node.vercel.app/22 | bash) pnpmneeds to be installed (npm i -g pnpm)jqneeds to be installed (brew install jq)- The devkitPro compiler toolchain needs to be installed
- Install required packages from the official registry:
sudo dkp-pacman -S switch-dev switch-freetype switch-libjpeg-turbo switch-libpng switch-harfbuzz switch-libwebp switch-libzstd switch-mbedtls switch-ffmpeg - Install the additional custom packages which are not in the official
devkitPro registry (
switch-v8,switch-skia,switch-libuv,switch-ada,switch-dav1d, and others). These are distributed via a Docker image:docker pull ghcr.io/tootallnate/pacman-packages:nxjs docker run -it --rm --platform linux/amd64 --mount type=bind,source="$(pwd)",target=/host ghcr.io/tootallnate/pacman-packages:nxjs sh -c 'cp packages/*/*.pkg.tar.zst /host' sudo dkp-pacman -U *.pkg.tar.zst - Now you can compile one of the example apps into a self-contained
.nro:./build.sh hello-world
Tip
The build.sh script bundles the TypeScript runtime, compiles the native
nxjs.nro runtime via make, and packages the selected example app from the
apps/ directory into a standalone .nro.
License
nx.js is released under the MIT License. Please see the LICENSE
file for more details.