What works in Nodepod
Nodepod is the browser-based Node.js runtime behind Codevre's terminal. This page covers what it supports, what it can't do, and how to work within browser limits.
Nodepod (opens in a new tab) runs Node.js programs inside a web page. It isn't a VM or a WebAssembly build of Node. It reimplements Node's APIs in JavaScript on top of an in-memory file system, runs processes as Web Workers, and serves HTTP servers through a service worker. In Codevre it runs on preview.codevre.dev, separate from the editor.
What works
Link to “What works”Node core modules with full implementations:
fs, path, events, stream, buffer, process, http, https, net, crypto, zlib, url, querystring, util, os, tty, child_process, assert, readline, module, timers, string_decoder, perf_hooks, constants, punycode
npm: npm install fetches from the public registry, resolves versions and checks package integrity, then installs into node_modules. npm run, npx and package.json scripts work. Installed packages are cached on your device, so reinstalling is fast.
Child processes: exec, execSync, spawn and fork work. Each process is a Web Worker.
HTTP servers: http.createServer and frameworks such as Express, Hono and Elysia listen on virtual ports. Codevre opens a Browser tab when they start. WebSockets to your server are bridged.
Tools: esbuild (as WebAssembly) and other pure-JS tools such as TypeScript's tsc, Prettier and most linters. Dev servers such as Vite may run, but are heavier in the browser.
Shell: a bash-like shell with pipes, redirects, variables, && and the common file commands.
Git: a built-in implementation. See Git and Source Control.
What doesn't work
Link to “What doesn't work”Some things simply don't exist inside a browser:
| Not available | Why | Use instead |
|---|---|---|
Native addons (.node files), node-gyp builds | The browser can't load native binaries | Pure-JS packages |
sharp, canvas (node-canvas) | Native | Browser <canvas> in the preview, jimp |
sqlite3, better-sqlite3 | Native | sql.js, or JSON files |
bcrypt | Native | bcryptjs |
puppeteer, playwright | Need a real browser binary | Test in the preview |
| Python, Ruby, Go, Docker, system packages | No OS to run them on | JavaScript tools |
Global installs (npm i -g) | No system-wide install location | npx, or local devDependencies |
Raw TCP/UDP sockets, dgram, tls servers | Browsers only allow fetch and WebSockets | HTTP APIs |
Modules that exist only as stubs: dns, worker_threads, vm, v8, tls, dgram, cluster, http2, inspector, domain, diagnostics_channel and async_hooks. Code can import them, but they don't do real work. For example, a BroadcastChannel from worker_threads is a no-op.
Networking from your code goes through the browser's networking. Outgoing requests from Node code (fetch, https.get) use Nodepod's proxying, and browser rules such as CORS can still apply. Some APIs block requests that come from a browser.
Performance: big installs and heavy builds run slower than on a native machine and use your device's memory. Very large projects, or many terminals running servers at once, can make the tab sluggish.
Paths
Link to “Paths”- Your project lives in the workspace folder.
pwdin a new terminal shows it;$CODEVRE_PROJECT_ROOTholds it. /is Nodepod's own root, with/tmp,/dev,/homeand/usr/local/bin. Don't write project paths as/file.js. Use paths relative to the project, orpath.join(__dirname, …).
Persistence
Link to “Persistence”- The file system lives in the page. Save to Codevre (Ctrl+S) keeps your project.
node_modules,.npmand.cachearen't saved. They're rebuilt frompackage.jsonwhen you reopen the project, using the cache on your device.- Running processes don't survive a reload or a runtime restart.
- Caches (packages,
node_modulessnapshots, compiled modules) are stored in IndexedDB and, where available, the Origin Private File System. They can grow to several gigabytes; snapshots older than seven days are removed. Clearing site data forpreview.codevre.devfrees the space.
Project tips
Link to “Project tips”- Prefer no-build front ends served by localhost:codevre:
index.html,style.css,script.js, with libraries from esm.sh or jsDelivr. - When you need bundling, use esbuild from a small
build.js. esbuild in Nodepod treats imports it can't resolve as external. A page error likeDynamic require of "./x.js" is not supportedmeans an import path is wrong. - For servers, use plain
httpor Express on port 3000 and sendCache-Control: no-store. - Restart a server after editing its code, or run it with a watcher (
node --watch).
Codevre's version
Link to “Codevre's version”Codevre runs a custom build of Nodepod (@scelar/nodepod, loaded from preview.codevre.dev/nodepod/). It's mostly the same as upstream. Differences:
- Git: UTF-8- and binary-safe clone, push and pull; push that records the commits it creates under GitHub's hashes; push that rejects non-fast-forward updates; pull that refuses to overwrite local changes or diverged history unless forced; and
sparse-checkout. - Credentials: Git authentication is passed to individual Git commands by the IDE, never through the environment.
- IDE integration: the
vreandghcommands, server-ready events for Browser tabs, and DevTools for server previews.
For Nodepod's own documentation, API and source, see the Nodepod repository (opens in a new tab).