explaingit

blackboardsh/electrobun

11,776TypeScriptAudience · developerComplexity · 3/5Setup · easy

TLDR

A TypeScript framework for building desktop apps using the Bun runtime and a built-in system webview, covering everything from project creation to packaging and shipping tiny binary-patch updates.

Mindmap

mindmap
  root((electrobun))
    What it does
      Desktop app framework
      App packaging
      Binary patch updates
    Tech stack
      Bun runtime
      System webview
      WGPU GPU rendering
    Use cases
      Note-taking apps
      GPU graphics tools
    Audience
      TypeScript developers
      Desktop app builders
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Build a cross-platform desktop app in TypeScript without learning native platform APIs

USE CASE 2

Ship a packaged app around 14 MB by using the OS webview instead of bundling a full browser

USE CASE 3

Deliver incremental updates as small as 4 KB using binary patch files instead of full re-downloads

USE CASE 4

Render GPU graphics directly on a native surface from TypeScript code using WGPU

Tech stack

TypeScriptBunWebViewWGPUThree.jsBabylon.js

Getting it running

Difficulty · easy Time to first run · 5min
License terms are not stated in the explanation.

In plain English

Electrobun is a framework for building desktop applications using TypeScript. It covers the full lifecycle: writing the app, packaging it for distribution, and shipping updates to users. The goal described in the README is to go from starting a new project to having something distributable in under fifteen minutes. Under the hood it uses Bun, a fast JavaScript runtime, to run your application's main process. The user interface is displayed through a webview, which is a browser component built into the operating system, so the app does not need to bundle a full browser to show web-based UI. This keeps the packaged app size small, around 14MB when using the system webview. If you prefer a consistent browser across all platforms, you can optionally bundle Chromium instead, which increases the size to around 16MB. App updates are delivered as binary patches that only describe what changed between versions, so updates can be as small as 4KB rather than a full re-download. The main process and the webview run in separate isolated processes and communicate through a typed RPC system. You define the messages each side can send and receive, and the library handles passing data between the two processes safely. For cases where a webview is not suitable, Electrobun also supports WGPU, which gives you direct access to the GPU from Bun TypeScript code. This lets you render graphics on a native GPU surface instead of inside a browser. The README also mentions adapters for Three.js and Babylon.js that work in this mode. You start a new project by running npx electrobun init. The README includes a list of community apps built with Electrobun, ranging from note-taking tools and audio players to Git clients and AI coding assistants.

Copy-paste prompts

Prompt 1
Using Electrobun, scaffold a new desktop app with `npx electrobun init` and set up a typed RPC channel so the Bun main process and the webview can exchange messages safely.
Prompt 2
I am building a desktop note-taking app with Electrobun. Write the Bun main-process code that listens for a `save-note` RPC call and writes the note content to a local file.
Prompt 3
Show me how to configure Electrobun to deliver binary patch updates to users so they only download what changed between versions, not a full reinstall.
Prompt 4
Set up WGPU rendering in an Electrobun app so I can draw a colored triangle on a native GPU surface from TypeScript without using a webview.
Prompt 5
Using Electrobun's Three.js adapter, render a rotating 3D cube on a native GPU surface inside a desktop app.
Open on GitHub → Explain another repo

← blackboardsh on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.