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. Today this is the <nano-terminal> web component and the demos at userland.run.
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 VM: basic Node.js (hello world, filesystem, crypto), and HTTP servers with live preview via a Service Worker bridge.
// 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
The live terminal, editor and preview ship as the <nano-terminal> web component, driven through the SDK — and are demonstrated at userland.run. (The old standalone make demo IDE was retired in favor of these.)