Deno (software) explained

Deno
Author:Ryan Dahl
Developer:Deno Land Inc[1] and contributors
Released:[2]
Programming Language:TypeScript, JavaScript, Rust, C++ (V8 bindings)
Operating System:Linux, macOS, Microsoft Windows
Genre:Runtime environment
License:MIT License[3]

Deno ([4]) is a runtime for JavaScript, TypeScript, and WebAssembly that is based on the V8 JavaScript engine and the Rust programming language. Deno was co-created by Ryan Dahl, who also created Node.js.[5]

Deno explicitly takes on the role of both runtime and package manager within a single executable, rather than requiring a separate package-management program.[6]

History

Deno was announced at JSConf EU 2018 by Ryan Dahl in his talk "10 Things I Regret About Node.js".[7] 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 build system GYP, node_modules and package.json, leaving out file extensions, magical module resolution with index.js and breaking the sandboxed environment of V8.[8] 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.

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

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.[15]

The official Deno 1.0 was released on May 13, 2020.[16]

Deno Deploy, inspired by Cloudflare Workers,[17] was released on June 23, 2021.[18] Announced May 4, 2022 Beta 4 improved the dashboard and added billing functionality.[19]

Deno Fresh 1.0 was announced June 28, 2022.[20] It features a new full stack web framework for Deno that by default sends zero JavaScript to the client. The framework has no build step which allows for an order of magnitude improvements in deployment times. Version 1.1 was released September 8, 2022.[21]

Deno SaaSKit beta was announced April 4, 2023.[22] It is an open-source, modern SaaS template built with Fresh and Deno.

Overview

Deno aims to be a productive and secure scripting environment for the modern programmer. 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.[23]

Comparison with Node.js

Deno and Node.js are both runtimes built on the V8 JavaScript engine developed by the Chromium Project, the engine used for Chromium and Google Chrome web browsers. They both have internal event loops and provide command-line interfaces for running scripts and a wide range of system utilities.

Deno mainly deviates from Node.js in the following aspects:

  1. Supports only ES Modules like browsers where Node.js supports both ES Modules and CommonJS. CommonJS support in Deno is possible by using a compatibility layer.[24] [25]
  2. Supports URLs for loading local or remote dependencies, similar to browsers, and uses module specifiers like npm: and node: to import NPM or polyfill Node.JS modules. Node.js supports both URLs[26] and modules.
  3. Does not require a package manager for resource fetching, thus no need for a registry like npm.[27]
  4. Supports TypeScript out of the box,[28] using a snapshotted TypeScript compiler or the swc compiler[29] with caching mechanisms.
  5. Aims for better compatibility with browsers with a wide range of Web APIs.
  6. Restricts file system and network access by default in order to run sandboxed code.
  7. Supports a single API to utilize promises, ES6 and TypeScript features whereas Node.js supports both promise and callback APIs.
  8. Minimizes core API size, while providing a large standard library with no external dependencies.
  9. Uses message passing channels for invoking privileged system APIs and using bindings.

Funding

On March 29, 2021, Deno Land Inc was announced, with backing in millions of dollars from Shasta Ventures, Mozilla Corporation and a few others. It was established to further the development of Deno and provide a commercial offering to users.

A year on, Deno announced a further $21 million in Series A funding led by Sequoia Capital.[30]

Release history

The tables below were created using the official Releases page.[31]

Deno

VersionLatest patch releaseRelease dateDate of last patch releaseDescription
2018-08-232018-11-12Rust rewrite and V8 snapshot
2018-11-272019-02-08Mildly usable
2019-02-182019-04-25Instead of importing a "deno" module, there is now a global variable called "Deno"
2020-05-132020-06-03Initial production release with CLI, first-class TypeScript Support, Rust APIs and improvements in HTTP server performance
2020-06-122020-07-03Various additions and fixes to the CLI, Rust 1.44.0
2020-07-132020-08-08Various additions and fixes to the CLI
2020-08-132020-09-04Various additions and fixes to the CLI, various improvements to the Deno language, TypeScript 3.9.7
2020-09-132020-10-10New web standard WebSocket API, automatic restarts on file change, integrated test coverage
2020-10-272020-11-23Faster tree-shaking and bundling, refactored REPL
2020-12-082020-12-30Compile standalone binaries via "deno compile", support TypeScript 4.1, experimental support for Mac ARM64
2021-02-052021-02-19Cross compilation and 60% smaller binaries for deno compile, a DNS resolver API, support for data URLs in import statements and web workers
2021-03-022021-04-02Experimental support for WebGPU API, built-in internationalization APIs enabled, support for fetching private modules, revamped coverage tooling, support for TypeScript 4.2
2021-04-132021-04-23Native HTTP/2 web server, Faster calls into Rust with serde_v8, Blob URL support & improvements to fetch api, Import completions in the LSP, Interactive permission prompt
2021-05-112021-05-17Improvements to the built in test runner, structured clone support in Web Workers, Web Storage API, support for remote import maps
2021-06-082021-06-29Official docker images, more web crypto APIs added, BroadcastChannel, abortable fetch, deno lint stabilized
2021-07-132021-07-26Support for generateKey, sign and verify web crypto APIs, native WebSocket server support, TypeScript support in REPL, support for MessagePort and MessageChannel
2021-08-102021-08-23Native HTTP web server stabilization, support for self.structuredClone, AbortSignal support, support for navigator.hardwareConcurrency API, experimental WebSocketStream API, FFI replaces native plugin system
2021-09-142021-10-04URLPattern, file locking APIs, mutual TLS support in fetch, TypeScript 4.4, URL parsing and std/http performance improvements
2021-10-122021-10-25New crypto APIs, deno uninstall subcommand, nested testing API, FFI improvements, new—compat flag for improved Node compatibility
2021-11-092021-12-03Fetch support for file URLs, new unstable signal listener API, support for specifying a reason when aborting an AbortSignal, improvements to Web Streams API, findLast and findLastIndex array methods, Deno to npm package build tool
2021-12-162022-01-12Import assertions and JSON modules, improvements to the Web Cryptography API, unref timers, unstable support for negotiating ALPN, TypeScript 4.5
2022-01-202022-01-20Config file auto-discovery, completion of Web Cryptography API, stabilization of test steps API, FFI improvements, LSP improvements
2022-02-172022-03-10New Deno vendor dependency, default permission prompt, new web streams for files, network sockets and stdio, CompressionStream and DecompressionStream supported, better errors for ops and resource sanistizers, improved console log
2022-04-142022-03-16Faster calls into Rust, auto-compression for HTTP response bodies, new subcommands (deno bench, deno task), security improvements, stricter defaults in programmatic permission, TypeScript 4.6, V8 10.0
2022-04-202022-05-12Various improvements to the Deno language, VSCode extension, and REPL. Improvements in Deno Test
2022-05-182022-06-09Updated default type checking behavior, various improvements to the Deno language, updates to the test runner
2022-06-152022-07-12No type-checking by default, various improvements to the Deno language, force a new line in REPL, TypeScript 4.7
2022-07-202022-08-11Type checking and emitting performance improvements, various improvements to the Deno language, Deno Test improvements, Updates to the new subprocess API, LSP improvements, addition of semver module
2022-08-242022-09-22deno init subcommand, experimental npm support, new HTTP server API, improvements to startup time, FFI API improvements
2022-09-292022-10-17Cache Web API, WebCrypto Secure Curves, --allow-sys permission flag, improvements to npm and Node.JS support, improvements to Deno.serve API, improved module download UI, developer experience improvement, TypeScript 4.8
2022-10-272022-11-08Major IDE improvements, Improvements to npm compatibility, navigator.language Web API, Improvements to deno task, Upgrade checker, Changes to Deno APIs, Updates to deno lint, V8 10.8, Node.js compatibility improvements, Changes to standard library APIs
2022-11-132022-12-01Various fixes and feature stabilisations, NPM package importer, auto discovery of the lock file, V8 10.9
2022-12-142023-01-16npm compatibility improvements, REPL changes, Quality of life improvements, Changes to Deno APIs, TypeScript 4.9, Changes to the standard modules
2023-01-262023-02-07Support for built-in Node.js modules (import "node:fs"), deno.json becomes an import map, deno fmt supports configuring semicolons
2023-02-242023-02-25Support for package.json, Stabilization of Node-API, Node compatibility layer for NodeJS moved to the Deno runtime itself, Stabilizations in Deno API, Change to pointer type in FFI API
2023-03-232023-04-18Enhanced Node.js compatibility, deno compile support for web workers and dynamic import, changes to Deno APIs, changes to Web APIs, changes to the standard library, TypeScript 5.0, V8 11.2
2023-04-282023-05-18Built in Key-value database, flatter configuration, no permission check for dynamic imports, further enhanced Node.js/npm compatibility, performance improvements, CLI improvements, changes to Deno APIs, V8 11.4
2023-05-232023-6-15Deno compile support for npm packages, glob support in Deno.json and CLI flags, support for IP addresses in TLS certificates, configuration file improvements, API Changes, Node.js compatibility improvements, TypeScript 5.0.4, V8 11.5
2023-07-052023-07-26New stable web server API, Node.js compatibility improvements, Deno API changes, Web API changes, LSP improvements, updates to standard library, TypeScript 5.1.6, V8 11.6
2023-08-032023-08-21More flexible security and expanded testing APIs
2023-09-192023-10-12Adding Jupyter support and fixes, TypeScript 5.2 support and fixes
2023-11-012023-12-05Deno.Server renamed to Deno.HttpServer, Jupyter support and fixes, Websocket features
2023-12-132024-01-13
2024-01-252024-02-15
2024-02-222024-03-14
2024-02-222024-03-14
2024-05-012024-05-21
2024-05-302024-06-19

Deno Fresh

Version numbers are based on releases from Github.[32]

VersionLatest patch releaseRelease dateDate of last patch releaseDescription
2022-06-282022-06-28Initial release
2022-08-092023-05-23Automatic JSX, new twind plug-in, Preact Signals support, Preact DevTools support, explicit rendering of 404 pages, stacked middleware, experimental Deno.serve support, showcase & "Made with Fresh" badges
2023-06-152023-06-15More datatypes supported in island props, support for passing JSX to islands and nesting islands, support for importing packages from npm, custom HEAD request handlers, overrides for headers and status from ctx.render, asynchronous plugin rendering, simplified testing
2023-07-182023-07-21Async Route Components. adding routes and/or middlewares from plugin. 500 error template fallback, error Boundaries, export multiple islands in the same file, Fresh linting rules, support for Deno.serve
2023-08-162023-09-06Faster page loads with ahead-of-time compilation, custom html, head and body tags, layouts (async layouts and async app wrapper, quicker typing with define functions
2023-10-102023-09-06
2023-12-012024-03-22

Deno SaasKit

Version numbers are bases on release numbers from the Github repository.[33]

VersionLatest patch releaseRelease dateDate of last patch releaseDescription
2023-04-042022-04-04Initial release
2023-04-19
2023-05-08
2023-06-06
2023-06-20Deno KV OAuth
2023-06-27
2023-08-062023-09-12
2023-12-19

Examples

A basic Hello, World! program in Deno:console.log("Hello, World!");Global Deno namespaces expose APIs that are not available in the browser.

An implementation of the Unix cat program: https://docs.deno.com/runtime/tutorials/unix_cat/** * cat.ts */for (const filename of Deno.args)

A simple Web server: https://deno.com/blog/v1.35Deno.serve((req) => new Response("hello world"));

Deno automatically downloads and caches the remote standard library files when the script is run, and then compiles the code.

Similarly, it 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):$ deno run -A https://deno.land/std/http/file_server.tsDownload https://deno.land/std/http/file_server.tsCompile https://deno.land/std/http/file_server.ts...HTTP server listening on http://0.0.0.0:4500/

External links

Notes and References

  1. Web site: Announcing the Deno Company. Ryan Dahl, Bert Belder. 2021-03-29.
  2. Web site: Contributors, denoland/deno, Github. 5 July 2019. GitHub.
  3. Web site: deno/LICENSE at main. GitHub. 5 July 2019.
  4. Web site: Deno Manual. deno.com. 2019-05-17.
  5. Web site: Schiemann . Dylan . December 26, 2018 . Deno: Secure V8 TypeScript Runtime from Original Node.js Creator . live . May 17, 2019 . InfoQ . en-US . May 17, 2019 . https://web.archive.org/web/20190517060537/https://www.infoq.com/news/2018/12/deno-v8-typescript .
  6. Web site: Ryan Dahl's Node.js regrets lead to Deno. https://web.archive.org/web/20190414195245/https://www.infoworld.com/article/3283250/ryan-dahls-nodejs-regrets-lead-to-deno.html. 2019-04-14. Paul Krill. InfoWorld. 2018-06-21.
  7. Dahl . Ryan . 10 things I regret about Node.js . JSConf EU . 2018-06-06 . YouTube . 2019-05-17.
  8. Web site: Design mistakes in Node. Dahl. Ryan. 2018-06-06. Github.
  9. Web site: denoland/deno, branch "golang". Github.
  10. Web site: Suggestion: Look into porting to Rust and using Tokio. GitHub.
  11. Web site: Tokio - The asynchronous run-time for the Rust programming language.. Tokio.rs.
  12. Web site: Protobuf seems like a lot of overhead for this use case?. Github.
  13. Web site: Remove flatbuffers. GitHub.
  14. Web site: April 15, 2019 . Replace flatbuffers . July 11, 2019 . GitHub . en-US.
  15. Web site: denoland/deno_std: deno standard modules. Github. 3 March 2022.
  16. Web site: Deno 1.0. deno.com. 2020-05-14.
  17. Web site: JavaScript Containers . https://archive.today/20220504191522/https://tinyclouds.org/javascript_containers . 4 May 2022 . 4 May 2022 . tinyclouds.org . Dahl . Ryan.
  18. Web site: Krill . Paul . 2021-06-24 . Deno Company unveils server-side JavaScript hosting service . 2022-04-14 . InfoWorld . en . https://archive.today/20220627113153/https://www.infoworld.com/article/3622914/deno-company-unveils-server-side-javascript-hosting-service.html . 27 Jun 2022.
  19. Web site: Krill . Paul . 2022-06-03 . Deno Deploy moves toward GA, adds paid plan . 2022-07-24 . InfoWorld . en.
  20. Web site: Luca . Casonato . 2022-07-22 . Introduction Fresh 1.0 as new full stack web framework for Deno . 2022-07-24 . Deno Blog . en.
  21. Web site: Casonato . Luca. 2022-09-08 . Fresh 1.1 - automatic JSX, plugins, DevTools, and more . 2022-09-10 . Deno Blog . en.
  22. Web site: Jiang . Andy. 2023-04-04 . Announcing Deno SaaSKit: an open-source SaaS template built with Fresh . 2022-04-04 . Deno Blog . en.
  23. Web site: Deno Is Ready for Production. 2020-07-01. InfoQ. en.
  24. Web site: Modules: ECMAScript modules | Node.js v17.6.0 Documentation.
  25. Web site: Deno - A modern runtime for JavaScript and TypeScript.
  26. Web site: Modules: ECMAScript modules | Node.js v17.6.0 Documentation.
  27. Web site: Deno - A modern runtime for JavaScript and TypeScript.
  28. Web site: Deno.js in Production. Key Takeaways. . Medium.com . 16 May 2022.
  29. Web site: Documentation. GitHub. 3 March 2022.
  30. Web site: Deno raises $21M . https://archive.today/20220622122104/https://deno.com/blog/series-a . 22 June 2022 . deno.com.
  31. Web site: 2020-12-30 . Releases . 2021-01-14 . GitHub.
  32. Web site: Releases.
  33. Web site: Releases.