Introduction to jiki
jiki (じき) is a lightweight, browser-based Node.js runtime. It lets you write files, install npm packages, run shell commands, and start dev servers, all in the browser without a backend.
What can you build with jiki?
- Interactive coding tutorials with real code execution and validation
- Online playgrounds for React, Vue, Svelte, or any npm package
- Documentation with runnable code snippets
- Browser-based IDEs with editor, terminal, and preview
- AI coding assistants that can read/write files and run code in a safe sandbox
- Testing sandboxes that run Jest or Vitest in the browser
Core capabilities
jiki gives you a Node.js-like environment in the browser with a rich set of features:
| Feature | Description |
|---|---|
| Virtual filesystem | In-memory FS with directories, symlinks, file watching, and persistence |
| Package manager | Install packages from npm with full dependency resolution and caching |
| Shell | Pipes, logical operators, recursive globs, tab completion, and background jobs |
| Transpiler | TypeScript and JSX via esbuild-wasm with source maps |
| Dev server | Vite, Next.js, SvelteKit, and Remix with HMR |
| Plugin system | 6 hook types for extensibility |
| Sandboxing | Resource limits for memory, files, network, and paths |
| Snapshots | Serialize and restore the entire container state |
How it works
jiki runs entirely in the browser. It uses esbuild-wasm for TypeScript/JSX transpilation, Service Workers to intercept fetch requests and route them to virtual HTTP servers, and Web Workers for isolated code execution. A custom module resolver implements the Node.js resolution algorithm so require() and import work as expected.
import { boot } from "@run0/jiki";
const container = boot();
container.writeFile("/hello.js", 'console.log("Hello!")');
const result = await container.run("node hello.js");
console.log(result.stdout); // "Hello!\n"
Next steps
- Installation — add jiki to your project
- Quick Start — build your first browser-based app