Skip to content

hyperpolymath/deno-bunbridge

Repository files navigation

License = deno-bunbridge

Access Bun-specific APIs and ecosystem from Deno.

Deno Bun Ecosystem

Overview

deno-bunbridge provides Deno implementations of Bun-specific APIs, allowing code written for Bun to run on Deno, and giving Deno users access to Bun ecosystem patterns.

What This Bridges

Bun API deno-bunbridge Equivalent Implementation

bun:sqlite

bunbridge/sqlite

FFI to libsqlite3 or better-sqlite3

Bun.serve()

bunbridge/serve

Wraps Deno.serve()

Bun.file()

bunbridge/file

Wraps Deno file APIs

Bun.spawn()

bunbridge/spawn

Wraps Deno.Command

Bun.write()

bunbridge/write

Wraps Deno.writeFile

Bun’s Zig FFI

bunbridge/ffi

Maps to Deno.dlopen

Installation

import { Database } from "jsr:@hyperpolymath/deno-bunbridge/sqlite";
import { serve } from "jsr:@hyperpolymath/deno-bunbridge/serve";

Quick Start

// Code that looks like Bun, runs on Deno
import { Database } from "deno-bunbridge/sqlite";

const db = new Database(":memory:");
db.run("CREATE TABLE users (id INTEGER PRIMARY KEY, name TEXT)");
db.run("INSERT INTO users (name) VALUES (?)", ["Alice"]);

const users = db.query("SELECT * FROM users").all();
console.log(users);

Roadmap

  • v0.1 — SQLite bridge (bun:sqlite API on Deno)

  • v0.2 — File and serve bridges

  • v0.3 — FFI compatibility layer

  • v1.0 — Full Bun API coverage

License

PMPL-1.0-or-later