Skip to content

Getting Started

Try it in the DevTools of your browser in this website

Section titled “Try it in the DevTools of your browser in this website”

You can open the DevTools here (maybe Ctrl + Shift + J on Windows/Linux and + + J on macOS) and try Nostalgist.js with a global variable Nostalgist. No extra setup is required.

// Launch an NES game
await Nostalgist.nes('flappybird.nes')
// Launch a Sega Genesis game
await Nostalgist.megadrive('30yearsofnintendont.bin')
// Launch a GBA game
await Nostalgist.gba('eliminator.gba')
// Or choose a ROM file from your disk
await Nostalgist.nes(showOpenFilePicker)

You can also use some online editor to give it a try.

You can try Nostalgist.js in Stackblitz by hacking this example, a homebrew retro game list.

If you want to use Nostalgist.js to build something cool, here are some choices to import it into your project.

If you are building a modern frontend project, you can use npm or its alternatives to install it to your project.

Terminal window
npm i nostalgist

Then you can import it and start hacking.

import { Nostalgist } from 'nostalgist'
await Nostalgist.nes('flappybird')

Simply add a script tag with a CDN link to your HTML.

<script src="https://unpkg.com/nostalgist"></script>

Then you can use the global variable Nostalgist in your code and start hacking.

await Nostalgist.nes('flappybird')

You can also use the ESM version of Nostalgist.js with CDN.

<script type="module">
import { Nostalgist } from 'https://esm.run/nostalgist'
</script>

You may want to read the API reference.