JavaScript Software Engineering

Deno Runtime for JavaScript and TypeScript

See also: JavaScript, JavaScript Bibliography and Bibliography of JavaScript Libraries and Web Frameworks

Original author(s)Ryan Dahl
Initial releaseMay 13, 2018; 2 years ago[1]
Stable release1.8.0[2]  / 2 March 2021; 3 days ago
Written inTypeScriptJavaScriptRustC++(V8 bindings)
Operating systemLinuxmacOSMicrosoft Windows
TypeRuntime environment
LicenseMIT License[3][4] 

Deno is a runtime for JavaScript and TypeScript that is based on the V8 JavaScript engine and the Rust programming language. It was created by Ryan Dahl, original creator of Node.js, and is focused on productivity.[5] It was announced by Dahl in 2018 during his talk “10 Things I Regret About Node.js”.[6] Deno explicitly takes on the role of both runtime and package manager within a single executable, rather than requiring a separate package-management program.[7][8]” (WP)


“Deno was announced on JSConf EU 2018 by Ryan Dahl in his talk “10 Things I Regret About Node.js”.[6] In his talk, Dahl mentioned his regrets about the initial design decisions with Node.js, focusing on his choices of not using promises in API design, usage of the legacy GYP building system, node_modules and package.json, leaving out file extensions, magical module resolution with index.js and breaking the sandboxed environment of V8.[9] He eventually presented the prototype of Deno, aiming to achieve system call bindings through message passing with serialization tools such as Protocol Buffers, and to provide command line flags for access control.” (WP)

“Deno was initially written in Go and used Protocol Buffers for serialization between privileged (Go, with system call access) and unprivileged (V8) sides.[10] However, Go was soon replaced with Rust due to concerns of double runtime and garbage collection pressure.[11] Tokio is introduced in place of libuv as the asynchronous event-driven platform,[12] and FlatBuffers is adopted for faster, “zero-copy” serialization and deserialization[13] but later in August 2019, FlatBuffers were finally removed[14] after publishing benchmarks that measured a significant overhead of serialization in April 2019.[15]” (WP)

“A standard library, modeled after Go’s standard library, was created in November 2018 to provide extensive tools and utilities, partially solving Node.js’ dependency tree explosion problem.[16]” (WP)

“The official Deno 1.0 was released on May 13, 2020.[17]” (WP)


“Deno aims to be a productive scripting environment for the modern programmer.[7] Similar to Node.js, Deno emphasizes event-driven architecture, providing a set of non-blocking core I/O utilities, along with their blocking versions. Deno could be used to create web servers, perform scientific computations, etc. Deno is open source software under the MIT License.[18]” (WP)

Comparison with Node.js

“Deno and Node.js are both runtimes built on Google’s V8 JavaScript engine, the same engine used in Google Chrome. They both have internal event loops and provide command-line interfaces for running scripts and a wide range of system utilities.” (WP)

“Deno mainly deviates from Node.js in the following aspects:[7]” (WP)

  1. Uses ES Module as the default module system, instead of CommonJS.
  2. Uses URLs for loading local or remote dependencies, similar to browsers.
  3. Includes a built-in package manager for resource fetching, thus no need for npm.
  4. Supports TypeScript out of the box, using a snapshotted TypeScript compiler with caching mechanisms.
  5. Aims for better compatibility with browsers with a wide range of Web APIs.
  6. Allows file system and network access in order to run sandboxed code.
  7. Redesigns API to utilize promises, ES6 and TypeScript features.
  8. Minimizes core API size, while providing a large standard library with no external dependencies.
  9. Using message passing channels for invoking privileged system APIs and using bindings.” (WP)


VersionLatest micro versionRelease dateDate of last micro versionDescription rewrite and V8 snapshot usable of importing a “deno” module, there is now a global variable called “Deno” tree-shaking and bundling, refactored REPL standalone binaries via “deno compile”, support TypeScript 4.1, experimental support for Mac ARM64 compilation and 60% smaller binaries for deno compile, a DNS resolver API, support for data URLs in import statements and web workers support for WebGPU API, built-in internationalization APIs enabled, support for fetching private modules, revamped coverage tooling, support for TypeScript 4.2
Legend:Old versionLatest versionFuture release

Via the official Releases[19] page


“This runs a basic Deno script without any file system or network permissions (sandbox mode):” (WP)

deno run main.ts

Explicit flags are required to enable permissions:

deno run --allow-read --allow-net main.ts

To inspect the dependency tree of the script, use the info subcommand:

deno info main.ts

A basic Hello, World! program in Deno looks just like it would in Node.js:

console.log("Hello, World!");

A global Deno namespace exposes APIs that are not available in the browser. A Unix cat program could be implemented as follows:

/* cat.ts */

/* Deno APIs are exposed through the `Deno` namespace. */
const { stdout, open, copy, args } = Deno;

// Top-level await is supported
for (let i = 0; i < args.length; i++) {
    const filename = args[i]; // Obtains command-line arguments.
    const file = await open(filename); // Opens the corresponding file for reading.
    await copy(file, stdout); // Performs a zero-copy asynchronous copy from `file` to `stdout`.

The Deno.copy function used above works much like Go’s io.Copy, where stdout (standard output) is the destination Writer, and file is the source Reader. To run this program, we need to enable read permission to the filesystem:

deno run --allow-read cat.ts myfile

The following Deno script implements a basic HTTP server:

// Imports `serve` from the remote Deno standard library, using URL.
import { serve } from "[email protected]/http/server.ts";

// `serve` function returns an asynchronous iterator, yielding a stream of requests
for await (const req of serve({ port: 8000 })) {
    req.respond({ body: "Hello, World!\n" });

When running this program, Deno will automatically download and cache the remote standard library files, and compile the code. Similarly, we can run a standard library script (such as a file server) directly without explicitly downloading, by providing the URL as the input filename (-A turns on all permissions):” (WP)

$ deno run -A
HTTP server listening on


  1. ^ “Contributors, denoland/deno, Github”. Retrieved 5 July 2019.
  2. ^ “Release v1.8.0”. Retrieved 3 March 2021.
  3. ^ “deno/LICENSE at master”GitHub. Retrieved 5 July 2019.
  4. ^ “The MIT License”Open Source Initiative. 17 September 2018. Retrieved 17 September 2018.
  5. ^ “Deno: Secure V8 TypeScript Runtime from Original Node.js Creator”InfoQ. Retrieved 2019-05-17.
  6. a b JSConf (2018-06-06), 10 Things I Regret About Node.js – Ryan Dahl – JSConf EU 2018, retrieved 2019-05-17
  7. a b c “Deno Manual” Retrieved 2019-05-17.
  8. ^ Paul Krill (2018-06-21). “Ryan Dahl’s Node.js regrets lead to Deno”InfoWorld.
  9. ^ Dahl, Ryan (2018-06-06). “Design mistakes in Node” (PDF). Github.
  10. ^ “denoland/deno, branch “golang””Github.
  11. ^ “Suggestion: Look into porting to Rust and using Tokio”GitHub.
  12. ^ “Tokio – The asynchronous run-time for the Rust programming language”
  13. ^ “Protobuf seems like a lot of overhead for this use case?”Github.
  14. ^ “Remove flatbuffers”GitHub.
  15. ^ “Replace flatbuffers”GitHub.
  16. ^ “denoland/deno_std: deno standard modules”Github.
  17. ^ “Deno 1.0” Retrieved 2020-05-14.
  18. ^ “Deno Is Ready for Production”InfoQ. Retrieved 2020-07-01.
  19. ^ “Releases”. 2020-12-30. Retrieved 2021-01-14.

External links




Fair Use Sources: