deno desktop turns a Deno project (anything from a single TypeScript file to a
Next.js app) into a self-contained desktop application. The output is a
redistributable binary that bundles your code, the Deno runtime, and a web
rendering engine into one bundle per platform.
Coming in Deno 2.9
deno desktop ships in Deno v2.9.0 and is not in a stable release yet. To try
it now, run deno upgrade canary to install the
canary build. The command, configuration
keys, and TypeScript APIs may still change before the feature is stable.
deno desktop Jump to headingWeb technology is the most widely-known UI toolkit in the world. Desktop apps built on web stacks (Electron, Tauri, Electrobun) take advantage of that, but each has tradeoffs you have to live with: huge binaries, missing platform support, no JavaScript ecosystem, no built-in update story, no framework integration.
deno desktop is opinionated about those tradeoffs:
deno desktop at a Next.js, Astro, Fresh,
Remix, Nuxt, SvelteKit, SolidStart, TanStack Start, or Vite SSR project and it
runs: the production server in release mode, the dev server with hot reload
under --hmr. No code changes are required to take an existing web project to
the desktop.latest.json manifest and
bsdiff patches; the runtime polls, applies, and rolls back automatically on
failed launches.Create a one-file desktop app:
main.ts
Deno.serve(() =>
new Response("<h1>Hello, desktop</h1>", {
headers: { "content-type": "text/html" },
})
);
The compiled binary opens a window pointed at a local HTTP server bound to your
Deno.serve() handler. Run it directly:
Deno.serve() automatically binds to the address the
webview navigates to, so you do not need to pass a port or hostname. See
HTTP serving for details.
desktop block in
deno.json.Deno.serve() integration and the serving model.Deno.BrowserWindow lifecycle, multiple
windows, events.bindings.<name>().prompt(), alert(), confirm() as
native popups.Notification API.--hmr for framework and
non-framework apps.Deno.autoUpdate(), manifests, bsdiff,
rollback.deno desktop relates to
Electron, Tauri, Electrobun, Dioxus.deno desktop CLI reference: the command,
its flags, and the deno.json desktop schema.