---
title: "Self-contained Executable Programs with Deno Compile"
description: "`deno compile` turns JavaScript and TypeScript programs into standalone binaries for Windows, macOS and Linux that run without Deno installed."
url: "https://swe.quest/articles/self-contained-executable-programs-with-deno-compile-1f904f454f37c8a8"
canonical: "https://deno.com/blog/deno-compile-executable-programs"
source: "Deno"
published: "2024-11-14"
difficulty: "medium"
kind: "How-to"
reading_minutes: 5
tags: ["javascript","typescript","build-systems","developer-tools"]
---

# Self-contained Executable Programs with Deno Compile

A post on [Deno](https://swe.quest/sources/deno.md), published 2024-11-14, 5 min read, How-to. Original: [https://deno.com/blog/deno-compile-executable-programs](https://deno.com/blog/deno-compile-executable-programs)

## Summary

\`deno compile\` turns JavaScript and TypeScript programs into standalone binaries for Windows, macOS and Linux that run without Deno installed. It works by bundling the module graph into an eszip file and injecting it with Sui into a slimmed-down runtime binary, denort. Because the bundle sits in a section of the executable, the result can still be code signed. Examples cover cross-compiling with \`--target\`, custom icons, preserved permission flags, and compiling npm itself, which ran about 1.9x faster on \`npm -v\`. Assets can be embedded as base64-encoded modules until native asset bundling arrives.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [JavaScript](https://swe.quest/tags/javascript.md) (Languages)
- [TypeScript](https://swe.quest/tags/typescript.md) (Languages)
- [Build systems](https://swe.quest/tags/build-systems.md) (Engineering practices)
- [Developer tools](https://swe.quest/tags/developer-tools.md) (Engineering practices)

## Prerequisites

- JavaScript/TypeScript basics ([easy posts on JavaScript](https://swe.quest/tags/javascript.md?difficulty=easy))
- Command-line tooling ([easy posts on Developer tools](https://swe.quest/tags/developer-tools.md?difficulty=easy))

## Keywords

Deno, deno compile, denort, eszip, Sui, npm, codesign

## Related posts

- [Deno 1.34: deno compile supports npm packages](https://swe.quest/articles/deno-1-34-deno-compile-supports-npm-packages-6066648b7bf9ee04.md): Deno · 2023-05-25 · Medium · 6 min read · JavaScript, Runtimes & VMs, Developer tools, TypeScript
  Deno 1.34 lets \`deno compile\` bundle npm packages and their dependencies into a single self-contained executable.
- [Deno 2.3: Improved deno compile, local npm packages, and more](https://swe.quest/articles/deno-2-3-improved-deno-compile-local-npm-packages-and-more-8da91030a8445369.md): Deno · 2025-05-01 · Medium · 11 min read · JavaScript, TypeScript, Runtimes & VMs, Developer tools, Observability
  Deno 2.3 lets deno compile bundle programs that use FFI and Node native add-ons, adds --include/--exclude control over embedded files, and exposes Deno.build.standalone to detect compiled binaries.
- [How the creator of Homebrew simplifies distributing software with tea and Deno](https://swe.quest/articles/how-the-creator-of-homebrew-simplifies-distributing-software-with-tea-and-deno-e9ec4cd1e9a620fe.md): Deno · 2023-07-25 · Easy · 3 min read · JavaScript, TypeScript, CI/CD, Build systems, Developer tools
  tea, Max Howell's successor to Homebrew, is written in TypeScript and shipped as a single executable via \`deno compile\`, avoiding the Node install / npm install friction of distributing JS tools.
- [Deno 2.6: dx is the new npx](https://swe.quest/articles/deno-2-6-dx-is-the-new-npx-58f73c73a151bd8c.md): Deno · 2025-12-10 · Medium · 16 min read · JavaScript, TypeScript, Runtimes & VMs, Supply chain security, Developer tools
  Deno 2.6 adds \`dx\`, an npx equivalent for running npm and JSR package binaries that defaults to full permissions, prompts before download and runs lifecycle scripts.
- [Deno 2.4: deno bundle is back](https://swe.quest/articles/deno-2-4-deno-bundle-is-back-ed93373e4555da2c.md): Deno · 2025-07-02 · Medium · 19 min read · JavaScript, TypeScript, Runtimes & VMs, Build systems, Developer tools
  Deno 2.4 brings back \`deno bundle\`, now built on esbuild, producing single-file bundles for Deno or browser targets with tree shaking, minification, sourcemaps and npm/JSR dependency support.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
