
Security News
Open Source Maintainers Feeling the Weight of the EU’s Cyber Resilience Act
The EU Cyber Resilience Act is prompting compliance requests that open source maintainers may not be obligated or equipped to handle.
react-emulatorjs
Advanced tools
Emulatorjs is a js library to configure and run retro games in web version of retroarch with great UI and features like save states, capturing screenshots, configuring controls, etc... Emulatorjs team did the great job to compile retroarch cores. Check out cores list.
react-emulatorjs
is a easiest way to use emulatorjs in React with full typescript support including all emulatorjs options. Available cores, available options.
Install react-emulatorjs
npm install react-emulatorjs
Next we have to provide url to ROM. It can be somewhere in the internet. Or we can upload a local file. Let's create a file handler to make url to our local blob.
Next we have to select core
and start the emulator when the rom
is ready.
import { ChangeEvent, useState } from "react"
import { EmulatorJS } from "react-emulatorjs"
function App() {
const [rom, setRom] = useState<string>()
const onFileSelect = async (e: ChangeEvent<HTMLInputElement>) => {
if (!e.target.files?.[0]) return
const file = e.target.files?.[0]
setRom(URL.createObjectURL(file))
}
return (
<>
<input type="file" onChange={onFileSelect} />
{rom && (
<EmulatorJS
EJS_core="nes" // emulator core
EJS_gameUrl={rom} // rom url
/>
)}
</>
)
}
And thats all! Now You can run nes
roms in browser.
Checkout codesandbox demo with this code.
The most important option is EJS_pathtodata
. This path points to emulatorjs's binaries. And the best performance option is keep them close as possible, on Your sever. And it is very easy.
data
folder from latest emulatorjs release and copy in to project's public
folder. For example, if You are using 'vite' data folder should be in /public/data
.<EmulatorJS
//...
EJS_pathtodata="/data"
/>
FAQs
React wrapper for emulatorjs
The npm package react-emulatorjs receives a total of 12 weekly downloads. As such, react-emulatorjs popularity was classified as not popular.
We found that react-emulatorjs demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The EU Cyber Resilience Act is prompting compliance requests that open source maintainers may not be obligated or equipped to handle.
Security News
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Research
/Security News
Undocumented protestware found in 28 npm packages disrupts UI for Russian-language users visiting Russian and Belarusian domains.