Servers
WebSocket chat
A chat room on Express and ws: the page talks to the server over a real WebSocket, and bash posts into the same room.
This is a real terminal. Click into it and type.
The project's files open here.
Changes save as you type. Press Escape, then Tab, to leave the editor.
The page the server serves shows here.
First run in this browser: the project is built once and cached, and npm and the WebAssembly build tools are downloaded on first use. Later runs start in seconds.
betaClientVM is pre-1.0 (v0.2.0): things can break, and APIs may change between releases. Found a bug? Open an issue.
About this demo
The server is the unmodified ws package on an Express app. When the page opens a WebSocket to its own origin, the preview’s service worker hands it to the server listening inside the instance; nothing leaves the tab.
Send a message in the page, or post one from bash with curl: every connected page gets it, and the server logs it in the terminal.
How it's built
const app = await vm.createInstance({ fs: { from: { home: { user: { app: chat } } } } });
app.onPortOpen((port, url) => (preview.src = url));
// the page's WebSocket reaches the ws server through the preview's service worker
await app.exec('npm install && npm start', { cwd: '/home/user/app' });More demos
View all →Frameworks
Todo app
A React todo app on the Vite dev server, with an API you can curl from bash and code that hot-reloads as you edit it.
- Vite 6
- React
- TypeScript
- bash
- git
Servers
Express server
A real npm install of Express from the registry, then its server, which restarts as you edit server.js.
- npm 11
- Express 4
- Node.js 24
Shell & tools
Shell & Node
An interactive bash with pipes, background jobs and Node.js, and no install step, so it is ready in a second.
- bash
- coreutils
- Node.js 24
- git