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 gameawait Nostalgist.nes('flappybird.nes')
// Launch a Sega Genesis gameawait Nostalgist.megadrive('30yearsofnintendont.bin')
// Launch a GBA gameawait Nostalgist.gba('eliminator.gba')
// Or choose a ROM file from your diskawait Nostalgist.nes(showOpenFilePicker)
Try it in online editors
Section titled “Try it in online editors”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.
Build something more complex
Section titled “Build something more complex”If you want to use Nostalgist.js to build something cool, here are some choices to import it into your project.
Use a package manager
Section titled “Use a package manager”If you are building a modern frontend project, you can use npm or its alternatives to install it to your project.
npm i nostalgist
yarn add nostalgist
pnpm i nostalgist
bun i nostalgist
Then you can import it and start hacking.
import { Nostalgist } from 'nostalgist'
await Nostalgist.nes('flappybird')
Use a CDN
Section titled “Use a CDN”Simply add a script tag with a CDN link to your HTML.
<script src="https://unpkg.com/nostalgist"></script>
<script src="https://cdn.jsdelivr.net/npm/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>
<script type="module">import { Nostalgist } from 'https://cdn.skypack.dev/nostalgist'</script>
Next steps
Section titled “Next steps”You may want to read the API reference.