Lifo
A tiny Linux-like OS written in TypeScript that runs in browsers, Node.js and serverless functions for sandboxing code and running dev stacks.
At a Glance
About Lifo
Lifo is an open-source, Linux-like operating system written in TypeScript that runs in a browser tab, a Node.js process or a serverless function. It is built by the team behind RapidNative and is listed at version 0.10.0 alpha on the homepage. It provides a shell, Unix commands, a Node.js compatibility layer and a package manager without WASM, an emulator or native dependencies.
What It Is
Lifo is a clean-room reimplementation of Unix-style OS and Node.js APIs in TypeScript, not a Linux distribution or a VM. A headless Sandbox API exposes a filesystem, a shell and Node.js as async calls, so an app, AI agent or terminal can run commands, write files and execute scripts. The project states it is aimed at sandboxing AI-generated code, browser IDEs, previews and teaching.
How It Works
The stack consists of a bash-like shell with pipes, redirection, globbing, subshells and job control, and 60+ commands such as ls, grep, sed, awk, tar, git and curl. A virtual filesystem persists to IndexedDB so sessions survive reloads, and a virtual network covers ports, TCP and DNS. The Node.js layer covers modules like http, fs, net, child_process, streams and crypto, and npm/npx install from the real registry. A service worker turns in-VM ports into live previews, with a fallback for browsers with incomplete service-worker support.
Real Stacks and Tradeoffs
The homepage shows Vite with React, Express, Postgres via PGlite, Supabase (tinbase), and Expo projects running unmodified in the tab. The project documents that it offers a compatibility subset of Node, does not run native Linux binaries, and that its isolation is JS-level, not a security boundary. Benchmarks published by the project report roughly 0.5 ms cold start in Node and about 27 ms in a browser tab, measured against WebContainers in headless Chromium.
Current Status
The site marks the release as alpha. A roadmap mentions a Node binary that isolates VMs on the host and tunnelling to replace Docker for dev sandboxes.
Community Discussions
Be the first to start a conversation about Lifo
Share your experience with Lifo, ask questions, or help others learn from your insights.
Pricing
Open Source (MIT)
Lifo core is released under the MIT license and can be used for free in a browser tab, a Node.js process, or a serverless function, with no infrastructure cost.
- MIT license
- 60+ commands and a bash-like shell
- Node.js compatibility layer
- Virtual filesystem with IndexedDB persistence
- Runs in the browser, Node, and serverless functions
Capabilities
Key Features
- Sandbox API with filesystem, shell and Node.js as async calls
- Bash-like shell with pipes, redirection, globbing and job control
- 60+ Unix commands
- Node.js compatibility layer
- Real npm and npx support
- Virtual filesystem persisted to IndexedDB
- Service worker live previews of in-VM ports
- AI-agent code sandboxing
- Runs in browser, Node and serverless functions
- Offline operation
- Package manager (pkg)
