Skip to content

TronbunDesktop Apps with TypeScript & Bun

Lightweight, fast, cross-platform desktop applications using native webviews. No Electron required.

Tronbun

Quick Start ​

bash
# Create a new project
npx tronbun init my-app
cd my-app && bun install

# Start developing with hot reload
npx tronbun dev

How It Works ​

Your backend runs in Bun. Your frontend runs in a native webview. They communicate over a type-safe IPC bridge.

typescript
import { WindowIPC, windowName, mainHandler } from "tronbun";

@windowName("MyApp")
class MainWindow extends WindowIPC {
  constructor() {
    super({ title: "My App", width: 800, height: 600 });
    this.navigate("public/index.html");
  }

  @mainHandler("greet")
  async handleGreet(name: string) {
    return `Hello, ${name}!`;
  }
}

new MainWindow();
typescript
// Auto-generated typed API — full IntelliSense
const result = await window.MyApp.greet("World");
document.getElementById("output")!.textContent = result;
// → "Hello, World!"

Compile to Native App ​

bash
npx tronbun compile

Produces a standalone .app (macOS) or .exe (Windows) with all web assets embedded — no external files needed.

Released under the GPLv3 License.