When you just need to build a tiny desktop app: TinyJS
How a micro JavaScript runtime uses native OS webviews to shrink the desktop footprint.
When it comes to building compact desktop applications, a software engineer named Tarwin Stroh-Spijer has carved out a unique niche by creating TinyJS. This JavaScript runtime enables the development of small applications—many of which weigh in at just 6MB or less on disk—compatible with macOS, Linux, and Windows. Unlike other frameworks, TinyJS doesn't rely on a separate UI layer; instead, it leverages the OS's built-in browser engine, such as WebKit, WebView2, or WebKitGTK, to render the app visually.
The key to TinyJS's efficiency lies in its use of a lightweight JavaScript runtime called txiki.js, which measures about 5.6MB. The launcher, which facilitates app execution, adds another megabyte or so. All development is done in JavaScript, HTML, and CSS—no need for compilation. TinyJS also eliminates the need for an HTTP server, as it utilizes the OS's interprocess communication mechanisms for data transfer, cutting down on security concerns and development time.
One of the main advantages of TinyJS is its ability to tap into the OS's features, such as dialogs, menus, tray functionality, auto-updates, and clipboard support. This eliminates the need to bundle separate plugins, as developers would have to do with frameworks like Tauri, which requires knowledge of Rust and comes with its own set of drawbacks.
TinyJS supports a range of JavaScript frameworks, including React, Vue, and Svelte, or can even be used without any dependencies at all. It can also be used to wrap a web page by pointing the window to a URL, allowing users to turn their favorite websites into desktop applications.
Stroh-Spijer has also created an "app store" on the desktop, where users can download a collection of sample apps, all free and ranging from practical to whimsical. These apps include a world clock, a clipboard history tool, a markdown editor, a desktop ghost, a SQLite browser, and even a clone of the iconic Winamp music player, each with a file size of under 8MB. The launcher checks the hash of the downloaded apps to ensure their validity, though users must trust Stroh-Spijer's intentions.
Ultimately, TinyJS offers a solution for those who desire smaller, more efficient desktop applications that can start quickly, consume less power, and provide a more streamlined computing experience in an era dominated by bloated commercial software and web browsers.
Written by urgent.news from The Register Science's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.
Also reported by 1 other outlet
- When you just need to build a tiny desktop app: TinyJS theregister.com