Write once, run on Deno and Bun.
-
Runtime Detection — Detect Deno, Bun, Node.js, or browser at runtime
-
Unified File System —
readTextFile,writeFile,readDir,stat, etc. -
Process Abstraction — Environment variables, subprocess execution, cwd
-
Type-Safe — Full TypeScript support with proper types
-
Zero Dependencies — No external packages required
-
Future: Zig Native — Performance-critical FFI via shared Zig libraries
import { RUNTIME, isDeno, isBun } from "bundeno/runtime";
import { readTextFile, writeTextFile } from "bundeno/fs";
import { exec, getEnv } from "bundeno/process";
// Works on both Deno and Bun!
console.log(`Running on: ${RUNTIME}`);
const content = await readTextFile("./config.json");
const home = getEnv("HOME");
const result = await exec(["git", "status"]);| Function | Description |
|---|---|
|
Returns |
|
Returns |
|
Returns |
|
Cached runtime value (evaluated once at import) |
| Function | Description |
|---|---|
|
Read file as UTF-8 string |
|
Read file as |
|
Write string to file |
|
Write bytes to file |
|
Check if file/directory exists |
|
Get file stats (size, mtime, isFile, etc.) |
|
Create directory (recursive by default) |
|
Remove file or directory |
|
List directory contents |
|
Copy a file |
|
Rename/move a file |
| Function | Description |
|---|---|
|
Get environment variable |
|
Set environment variable |
|
Get all environment variables |
|
Get current working directory |
|
Change current working directory |
|
Exit the process |
|
Get command line arguments |
|
Run command and get result |
|
Run command and return stdout as string |
The JavaScript runtime landscape is fragmented. Deno and Bun have different APIs for common operations:
| Operation | Deno | Bun |
|---|---|---|
Read file |
|
|
Write file |
|
|
Subprocess |
|
|
FFI |
|
Native Zig imports |
bundeno abstracts these differences so your code works everywhere.
┌─────────────────────────────────────────────┐
│ Your Code │
└─────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────┐
│ bundeno API │
│ (fs, process, sqlite, ffi, ...) │
└─────────────────────────────────────────────┘
│
┌────────────┴────────────┐
▼ ▼
┌─────────────────┐ ┌─────────────────┐
│ Deno Native │ │ Bun Native │
│ Deno.* │ │ Bun.* │
└─────────────────┘ └─────────────────┘See ROADMAP.adoc for planned features.
-
v0.1 — Foundation (fs, process, runtime detection)
-
v0.2 — Extended APIs (SQLite, WebSocket, Crypto)
-
v0.3 — Zig Native (shared FFI libraries)
-
v1.0 — Stable API, full test coverage
See CONTRIBUTING.adoc for guidelines.
PMPL-1.0-or-later. See LICENSE.txt.