Nodepack
By using clever hacks like shimming Node.js APIs, an in-memory file system, and code transformation, we can run basic Node.js apps cost-effectively in the browser without containers or server-side sandboxes.
Core trick
Shims Node.js APIs over an in-memory filesystem and runs CJS-transformed code in QuickJS in the browser, with no server sandbox.
Tags
Description
By using clever hacks like shimming Node.js APIs, an in-memory file system, and code transformation, we can run basic Node.js apps cost-effectively in the browser without containers or server-side sandboxes.
This enables new uses like interactive server-side JS playgrounds, in-browser AI coding agents, and AI-assisted coding interviews.
Nodepack uses QuickJS, Monaco editor, and Claude AI models.
Try Nodepack at https://nodepack.vercel.app.
Opus 4.6 Use: We used Opus 4.6 for research, planning, implementation, iteration, and as if that wasn’t enough, we also used it to power the AI coding agent in Nodepack.
Demo: Nodepack is functional, as demonstrated by the examples. While full Node.js parity is a massive effort, Nodepack proves what is possible with more time and resources.
README excerpt
# Nodepack Run a Node.js coding environment (with AI coding agent) directly in the browser without server infrastructure. > ⚠️ NOT a fork of VS Code ⚠️ Try it out: https://nodepack.vercel.app <a href="https://nodepack.vercel.app" target="_blank" rel="noopener noreferrer"> <img src="./assets/nodepack-cover.png" alt="Nodepack"> </a> ## Motivations Traditionally, Node.js is meant to be run on the server. With some clever hacks (e.g. shimming of Node.js APIs, transforming CJS code, using workers to intercept requests), we managed to achieve good support for running basic Node.js apps in the browser, which unlocks many exciting new use cases, such as: - Interactive playground for server-side JS libraries - Running AI coding agents in the browser. **Imagine being able to try Claude Code right in your browser!** - Conducting AI-assisted coding interviews in a cost-effective manner (no need for containers or server-side sandboxes) Other reasons: - **Cost**: StackBlitz's WebContainers can run Node.js in the browser, but requires licensing for commercial use, and it's pretty heavy (and for good reason) - **Learning**: Educational project to understand JavaScript runtimes better - **Open source**: Can be freely used and modified ## Features - **JavaScript execution**: Powered by QuickJS WASM engine (safer than `eval()`) - **Virtual file System**: In-memory filesystem with full CRUD operations, powered by memfs - **Node.js modules**: Shimmed `assert`, `buffer`, `events`, `fs