Open Source

Node.js in your browser

Run Node.js, Next.js, Vite, and Express entirely in the browser. No server required.

$ npm install almostnode
npm version GitHub stars License
server.js
⌘S to re-run
Terminal
Click Run to start the server.
Preview localhost:3000
output appears here

Everything you need

Virtual Filesystem

POSIX-compatible in-memory filesystem with watch, stat, and recursive operations.

Node.js Runtime

Execute JS/TS with 40+ shimmed modules — fs, path, http, crypto, streams, and more.

npm in the Browser

Install real npm packages, resolve dependencies, extract tarballs — all client-side.

Framework Dev Servers

Built-in Next.js and Vite dev servers with file-based routing and React support.

Hot Module Replacement

React Refresh, CSS Modules, and instant file updates without page reload.

Security Modes

Cross-origin sandbox, Web Worker isolation, or same-origin main thread execution.

Try it live

HTTP Server

Run a Node.js HTTP server in the browser. Edit the code, hit Run, and see it serve pages live.

http · require()

Next.js App

A full Next.js development server with App Router, file-based routing, and HMR.

next.js · app router · hmr

Vite Dev Server

Vite running in the browser with React, hot module replacement, and npm packages.

vite · react · hmr

Express Server

Express.js with routing, middleware, and JSON APIs — entirely in your browser.

express · npm install

Common questions

What is almostnode for?
Running demos and playgrounds of Node.js projects directly in the browser — no backend server needed. Think interactive documentation, code tutorials, and live examples that work from a static HTML page.
Can I use this for AI coding agents?
Yes. An AI agent can write code, execute it via almostnode, inspect output, and iterate — all client-side. No sandbox server to provision or manage. For untrusted AI-generated code, run it in a sandboxed cross-origin iframe.
Is this production-ready?
No. almostnode is experimental. It covers common Node.js APIs but not all edge cases. Expect bugs, especially with complex npm packages that rely on native modules or Node.js internals. Please file issues on GitHub.
How should I handle security?
Always run untrusted code in a cross-origin sandboxed iframe (sandbox="allow-scripts"). almostnode supports both same-origin and cross-origin modes via the service worker bridge. See the Security docs for setup details.
How does this differ from WebContainers?
almostnode is ~50KB (vs ~2MB), starts instantly (vs 2-5s), and runs on the main thread or a Web Worker. WebContainers provide a full Linux kernel with real TCP/IP and native module support. almostnode is better for lightweight playgrounds and demos; WebContainers for full dev environments.
What Node.js modules are supported?
40+ shimmed modules including fs, path, http, crypto, stream, buffer, events, url, zlib, and more. These are browser-compatible implementations — not the full Node.js API, but enough for most web frameworks and npm packages. See the API Reference.
Does it work offline?
The runtime works offline once loaded. However, npm.install() fetches packages from the npm registry, so it requires an internet connection. You can pre-populate the virtual filesystem with package files for offline use.