Electrobun is a framework designed for building ultra-fast, tiny, and cross-platform desktop applications using TypeScript. Leveraging the Bun runtime for the main process and native system WebViews (WebKit on macOS, WebView2 on Windows, WebKitGTK on Linux) for rendering, it offers a compelling alternative to Electron by drastically reducing bundle sizes (often around 12-64MB) and memory footprint, as it avoids bundling a full Chromium instance. The framework provides a complete TypeScript-first API for both main and renderer processes, including type-safe RPC for inter-process communication, and eliminates the need for languages like Rust (as seen in Tauri). It boasts a differential update mechanism (bsdiff) allowing for extremely small application updates, sometimes as low as 4KB. Current stable versions are `v1.x`, with active beta development continuing in the `v1.17.x-beta` series, indicating a frequent release cadence for enhancements and fixes.
npm install electrobunVerified import paths — ran on the pinned version, not inferred.
This quickstart initializes a new Electrobun project, demonstrates basic main process window creation, a preload script for exposing IPC to the renderer, and shows how to run the application in development mode.
Review release notes for each update, especially when migrating between minor versions or beta cycles. Ensure your Bun runtime version is compatible with the Electrobun version.
Thoroughly test your application's UI on all target platforms (macOS, Windows, Linux) to ensure consistent appearance and behavior. Be mindful of platform-specific CSS or JavaScript quirks. Consider using 'bundleCEF' flag for Chromium consistency if needed, though this increases app size.
Stay updated with Bun's releases and documentation. Report any Bun-related issues encountered within Electrobun to both project maintainers. Ensure your development environment has a consistent and recommended Bun version.
Always use the correct import paths: `import { ... } from 'electrobun/bun';` for main process code and `import { ... } from 'electrobun/view';` for renderer process (webview) code. Consult the official documentation for specific API import locations.Install Bun according to its official documentation (`curl -fsSL https://bun.sh/install | bash`) or ensure the `bun` executable is in your system's PATH.
Ensure main process code imports from `electrobun/bun` (e.g., `import { BrowserWindow } from 'electrobun/bun';`) and renderer process code imports from `electrobun/view` (e.g., `import { ipcRenderer } from 'electrobun/view';`). Verify that `electrobun` is correctly installed in `node_modules` (or `bun_modules`).When using `electrobun` CLI commands (like `electrobun init`, `electrobun dev`, `electrobun build`), prefix them with `bunx` (e.g., `bunx electrobun init`) if `electrobun` is only a local dependency. Alternatively, ensure the `node_modules/.bin` directory is in your PATH, or install `electrobun` globally if preferred (though `bunx` is generally recommended for local CLI tools).