Getting started

Web demo / IDE

A browser-based IDE built on NanoVM: a file tree, a code editor, and a console / preview panel — with HTTP servers rendered live in an iframe.

Layout

  • File tree — browse and edit the in-memory POSIX filesystem.
  • Code editor — write JavaScript or TypeScript that runs inside the VM.
  • Console / preview — see stdout, or a live iframe for servers.

Bundled examples

The demo ships examples that execute inside the emulator: basic Node.js (hello world, filesystem, crypto), and HTTP servers with live preview via a Service Worker bridge.

javascript
// runs inside NanoVM
const http = require("http");
http.createServer((req, res) => {
  res.end("served from RISC-V\n");
}).listen(3000);

How the preview works

Requests to the preview iframe are intercepted by a Service Worker and injected into the server running inside the VM; the response is streamed back out to the iframe. See Virtual server for the full request path.

Running it

bash
make demo   # builds WASM with bundled binaries + starts Vite
Want this in your own app rather than the bundled demo? The SDK (@userland-run/nano-sdk) exposes the same capabilities — files, processes, a shell, serve mode and scripting — as a typed package. See the SDK overview and Serve mode.