Native webview · TypeScript both sides · single-file binary

Desktop apps that are native, tiny, and all TypeScript.

Butter gives you a native window with a webview and a direct IPC bridge between your TypeScript backend and your frontend — no bundled browser engine, no background servers. Write native C, Moxy, Rust, or Zig and call it straight from TypeScript. Powered by Bun.

⌘myapp · native window, ~60MB
🖥️
Bun process host · TypeScript
on("greet", (name) => `Hello, ${name}!`)
🪟
Native shim WKWebView · WebKitGTK · WebView2
await butter.invoke("greet", "World")
⚙️
Native FFI C · Moxy · Rust · Zig
const math = await native("math"); math.fibonacci(20) → 6765, computed natively
Features

Everything Electron has, at a fraction of the size.

No bundled Chromium, no Node, no Rust required. Just Bun, the OS webview, and your TypeScript.

🪟

Native webview

Uses the OS webview — WKWebView on macOS, WebKitGTK on Linux, WebView2 on Windows. No bundled browser engine.

⚡

Shared-memory IPC

A direct bridge between host and webview over a 128KB shared-memory ring buffer. Length-prefixed frames, no pipes.

🟦

TypeScript on both sides

Your backend runs in Bun, your frontend in the webview — one language end to end, with typed IPC if you want it.

⚙️

Native extensions

Drop a .c, .mxy, .rs, or .zig file into src/native/ — Butter auto-compiles it and generates typed FFI bindings.

📦

Single-file binary

butter compile embeds every asset and the shim into one ~60MB executable. No installer plumbing required.

🚀

Installers built in

butter package produces a DMG on macOS, an AppImage on Linux, and an NSIS setup.exe on Windows.

🔌

Batteries-included plugins

Dialogs, tray, notifications, clipboard, global shortcuts, SQLite, KV store, sidecars, auto-update, and more.

🔒

Capability permissions

Lock down what the webview can invoke with a flat allowlist or grouped capabilities, plus a configurable CSP.

🔥

Hot-reloading dev mode

butter dev opens a native window with DevTools, recompiles native code, and reloads on file changes.

How it works

Two processes, one ring buffer.

A Bun process runs your host TypeScript; a native shim owns the window and webview. They talk over shared memory — no web server, no file:// CORS.

Bun runs the host

Your backend TypeScript runs in Bun. Register handlers with on(), push events with send().

The shim owns the window

A tiny native shim opens an OS webview and serves your assets over the butter:// protocol.

They talk over shared memory

Two ring buffers carry length-prefixed JSON frames between host and webview at 60 Hz.

Native code when you need it

C / Moxy / Rust / Zig sources auto-compile to a shared library and bind directly via FFI.

Architecture

No bundled browser. No background server.

  • ✦No web server — assets are served through the butter:// custom protocol, sidestepping file:// CORS.
  • ✦No bundled browser — Butter uses the OS native webview, so binaries stay around ~60MB.
  • ✦Shared-memory IPC — 128KB region: a 64B header plus two equal ring buffers, host ↔ webview.
  • ✦Native extensions — C, Moxy, Rust, and Zig all cross the C ABI, fingerprinted so rebuilds only run on change.
  • ✦Single binary — butter compile strips symbols and embeds everything into one executable.
Bun process (host TS) Native shim (child) import { on } from native window "butter" IPC WKWebView (macOS) native via FFI: <--> WebKitGTK (Linux) C / Moxy / Rust / Zig WebView2 (Windows) 128KB shared-memory ring buffer ┌────────┬───────────────┬───────────────┐ │ header │ host → webview │ webview → host │ │ 64B │ ring buffer │ ring buffer │ └────────┴───────────────┴───────────────┘
Get started

From zero to a native window in minutes.

Requires Bun v1.2+. Install the CLI, scaffold a project, and run a native dev window.

terminal
# 1. install the CLI (Bun v1.2+)
bun add -g butterframework
# or: brew tap wess/packages && brew install butter

# 2. create a new project
butter init myapp
cd myapp
bun install

# 3. develop in a native window (hot reload + DevTools)
bun run dev

# 4. ship a single-file binary, then a DMG / AppImage / installer
bun run build
butter package

Templates: vanilla (default), react, svelte, vue — e.g. butter init myapp --template react. Verify your toolchain with butter doctor.

Build something native today.

Open source under MIT. TypeScript on both sides, native performance where you need it, zero configuration.