TinyJS: 6MB Desktop Apps via OS WebViews, No Chromium Bundling
TinyJS enables building desktop applications around 6MB by leveraging OS-provided WebViews (WebKit, WebView2, WebKitGTK) and the txiki.js runtime, avoiding Electron's 150MB Chromium bundle and Tauri's Rust requirement, while providing full JS capabilities, OS IPC, SQLite, and auto-updates via a zero-compilation HTML/CSS/JS workflow.
Software engineer Tarwin Stroh-Spijer created TinyJS , an open-source JavaScript runtime for building tiny desktop applications on macOS, Linux, and Windows. Many apps occupy roughly 6 MB on disk, a stark contrast to the 150 MB baseline of Electron apps.
How TinyJS Achieves Its Small Footprint
TinyJS does not ship a browser engine. Instead it uses each operating system's built-in WebView component:
macOS → WebKit Windows → WebView2 (Chromium-based but shared system component)
Linux → WebKitGTK Because the rendering layer is provided by the OS, the TinyJS starter kit is only about 5.6 MB and the launcher adds roughly 1 MB ; the rest is developer code. The core runtime is txiki.js , an ultra-compact JavaScript engine written by Saúl Ibarra Corretgé, which makes Deno and Bun look like “giant objects” by comparison.
Comparison with Electron and Tauri
Electron
Electron bundles a full Chromium instance with every application, guaranteeing pixel-perfect cross-platform consistency but paying a heavy size penalty: even a minimal Electron app exceeds 150 MB . TinyJS accepts minor visual differences across platforms (due to each OS's rendering engine) in exchange for a 25× size reduction.
Tauri
Tauri also targets small binaries (~10 MB) but requires the developer to write the backend in Rust , adding a learning curve. TinyJS keeps the entire stack in JavaScript/TypeScript. Moreover, Tauri expects developers to import plugins one by one for features like dialogs, menus, tray icons, clipboard, and auto-updates, whereas TinyJS delegates those capabilities to the OS out of the box.
Core Architecture
No bundled HTTP server – TinyJS uses OS-level inter-process communication (IPC) for data transfer between the frontend (WebView) and the backend (txiki.js), eliminating the need for a local HTTP server and its associated security surface.
Zero compilation – Applications are written in plain JavaScript, CSS, and HTML. No build step is required unless the developer opts into a framework like Vite, React, Vue, or Svelte.
System integrations – Secure credential storage, SQLite databases, and automatic updates are supported natively.
Website wrapping – Pointing the WebView at a URL turns any web site into a desktop app instantly.
Development Workflow
Project scaffolding
tinyjs new appnameThis generates a minimal project structure. Two key files: main.js – “backend” code that exposes services to the frontend. It can perform system operations that browser JavaScript cannot.
Frontend files (HTML/CSS/JS) – standard web UI.
Backend API example
export const api: Record<string, TinyApiHandler> = {
hello: async ({ name }: { name: string }) => 'hi ' + name + ' — from the backend',
};Frontend consumption
await tiny.api.call('hello', { name: 'World' });Running with hot module replacement
tinyjs devExample Applications (App Store)
Stroh-Spijer ships a built-in app store containing 25 free demo applications, all running entirely on the desktop:
World Clock – 3.8 MB ZIP
Clipboard History – 3.7 MB
Markdown Editor – 4.9 MB
Desktop Mascot – 3.8 MB
SQLite Browser – 4.1 MB
Winamp Clone – 7.4 MB
Early testers report some macOS-originated apps exhibit bugs on Windows, which is expected for a young cross-platform project.
Benefits and Limitations
Fast startup – tiny binaries load almost instantly.
Low resource usage – reduced memory footprint and, theoretically, lower laptop battery drain.
Cross-platform visual variance – because each OS renders with its own WebView, pixel-perfect consistency is not guaranteed.
Maturity – the ecosystem is nascent; some rough edges remain.
TinyJS demonstrates that even on modern powerful hardware, there is still strong demand for lightweight, resource-efficient desktop tools — a philosophy reminiscent of 1990s software craftsmanship.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
21CTO
21CTO (21CTO.com) offers developers community, training, and services, making it your go‑to learning and service platform.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
