Deno (software)
![]() Logo used since 2024 | |
Original author(s) | Ryan Dahl |
---|---|
Developer(s) | Deno Land Inc[1] and contributors |
Initial release | May 13, 2018[2] |
Stable release | 2.2.11[3] ![]() |
Repository | github |
Written in | TypeScript, JavaScript, Rust, C++ (V8 bindings) |
Operating system | Linux, macOS, Microsoft Windows |
Type | Runtime environment |
License | MIT License[4] |
Website | deno![]() |
Deno (/diːnoʊ/[5]) 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, the creator of Node.js[6] and Bert Belder.[7]
Deno explicitly takes on the role of both runtime and package manager within a single executable, rather than requiring a separate package-management program.[5][8]
History
[edit]Deno was announced at JSConf EU 2018 by Ryan Dahl in his talk "10 Things I Regret About Node.js".[9] 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.[10] 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.[11] However, Go was soon replaced with Rust due to concerns of double runtime and garbage collection pressure.[12] Tokio was introduced in place of libuv as the asynchronous event-driven platform,[13] and FlatBuffers was adopted for faster, "zero-copy" serialization and deserialization[14] but later in August 2019, FlatBuffers was removed[15] after publishing benchmarks that measured a significant overhead of serialization in April 2019.[16]
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.[17]
The official Deno 1.0 was released on May 13, 2020.[18]
Deno Deploy, inspired by Cloudflare Workers,[19] was released on June 23, 2021.[20] Announced May 4, 2022 Beta 4 improved the dashboard and added billing functionality.[21]
Deno Fresh 1.0 was announced June 28, 2022.[22] 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.[23]
Deno SaaSKit beta was announced April 4, 2023.[24] It is an open-source, modern SaaS template built with Fresh and Deno.
Deno 2 was released October 9, 2024.[25] It primarily brings Node.js compatibility improvements and removes deprecated features.
Overview
[edit]Deno aims to be a productive and secure scripting environment for the modern programmer.[5] 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.[26]
Comparison with Node.js
[edit]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:[5]
- 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.[27][28]
- Supports URLs for loading local or remote dependencies, similar to browsers, and uses module specifiers like
npm:
andnode:
to import NPM or polyfill Node.JS modules. Node.js supports both URLs[29] and modules. - Does not require a package manager for resource fetching, thus no need for a registry like npm.[30]
- Supports TypeScript out of the box,[31] using a snapshotted TypeScript compiler or the swc compiler[32] with caching mechanisms.
- Aims for better compatibility with browsers with a wide range of Web APIs.
- Restricts file system and network access by default in order to run sandboxed code.
- Supports a single API to utilize promises, ES6 and TypeScript features whereas Node.js supports both promise and callback APIs.
- Minimizes core API size, while providing a large standard library with no external dependencies.
- Uses message passing channels for invoking privileged system APIs and using bindings.
Funding
[edit]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.[1]
A year on, Deno announced a further $21 million in Series A funding led by Sequoia Capital.[33]
Examples
[edit]![]() | This article may require cleanup to meet Wikipedia's quality standards. The specific problem is: Reads like a software tutorial. Some code examples may be useful to illustrate aspects of the framework, but they should be selected for the purpose of providing context to an encyclopedia article on the software. (July 2023) |
Global Deno
namespaces expose APIs that are not available in the browser.
An implementation of the Unix cat program: [1]
/** * cat.ts */ for (const filename of Deno.args) { const file = await Deno.open(filename); await file.readable.pipeTo(Deno.stdout.writable, { preventClose: true }); }
A simple Web server: [2]
Deno.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.ts Download https://deno.land/std/http/file_server.ts Compile https://deno.land/std/http/file_server.ts ... HTTP server listening on http://0.0.0.0:4500/
References
[edit]- ^ a b Ryan Dahl, Bert Belder (2021-03-29). "Announcing the Deno Company".
- ^ "Contributors, denoland/deno, Github". GitHub. Retrieved 5 July 2019.
- ^ "Release 2.2.11". 18 April 2025. Retrieved 24 April 2025.
- ^ "deno/LICENSE at main". GitHub. Retrieved 5 July 2019.
- ^ a b c d "Deno Manual". deno.com. Retrieved 2019-05-17.
- ^ Schiemann, Dylan (December 26, 2018). "Deno: Secure V8 TypeScript Runtime from Original Node.js Creator". InfoQ. Archived from the original on May 17, 2019. Retrieved May 17, 2019.
- ^ "The JavaScript ecosystem is 'hopelessly fragmented'... so here is another runtime: Deno is now a company". Archived from the original on 2024-06-25. Retrieved 2025-01-10.
- ^ Paul Krill (2018-06-21). "Ryan Dahl's Node.js regrets lead to Deno". InfoWorld. Archived from the original on 2019-04-14.
- ^ Dahl, Ryan (2018-06-06). 10 things I regret about Node.js. JSConf EU. Retrieved 2019-05-17 – via YouTube.
- ^ Dahl, Ryan (2018-06-06). "Design mistakes in Node" (PDF). Github.
- ^ "denoland/deno, branch "golang"". GitHub.
- ^ "Suggestion: Look into porting to Rust and using Tokio". GitHub.
- ^ "Tokio - The asynchronous run-time for the Rust programming language". Tokio.rs.
- ^ "Protobuf seems like a lot of overhead for this use case?". GitHub.
- ^ "Remove flatbuffers". GitHub.
- ^ "Replace flatbuffers". GitHub. April 15, 2019. Retrieved July 11, 2019.
- ^ "denoland/deno_std: deno standard modules". GitHub. 3 March 2022.
- ^ "Deno 1.0". deno.com. 13 May 2020. Retrieved 2020-05-14.
- ^ Dahl, Ryan (4 May 2022). "JavaScript Containers". tinyclouds.org. Archived from the original on 4 May 2022.
- ^ Krill, Paul (2021-06-24). "Deno Company unveils server-side JavaScript hosting service". InfoWorld. Archived from the original on 27 Jun 2022. Retrieved 2022-04-14.
- ^ Krill, Paul (2022-06-03). "Deno Deploy moves toward GA, adds paid plan". InfoWorld. Retrieved 2022-07-24.
- ^ Luca, Casonato (2022-07-22). "Introduction Fresh 1.0 as new full stack web framework for Deno". Deno Blog. Retrieved 2022-07-24.
- ^ Casonato, Luca (2022-09-08). "Fresh 1.1 - automatic JSX, plugins, DevTools, and more". Deno Blog. Retrieved 2022-09-10.
- ^ Jiang, Andy (2023-04-04). "Announcing Deno SaaSKit: an open-source SaaS template built with Fresh". Deno Blog. Retrieved 2022-04-04.
- ^ "Announcing Deno 2". Deno Blog. 2024-10-09. Retrieved 2024-10-27.
- ^ "Deno Is Ready for Production". InfoQ. Retrieved 2020-07-01.
- ^ "Modules: ECMAScript modules | Node.js v17.6.0 Documentation".
- ^ "Deno - A modern runtime for JavaScript and TypeScript".
- ^ "Modules: ECMAScript modules | Node.js v17.6.0 Documentation".
- ^ "Deno - A modern runtime for JavaScript and TypeScript".
- ^ "Deno.js in Production. Key Takeaways". Medium.com. Retrieved 16 May 2022.
- ^ "Documentation". GitHub. 3 March 2022.
- ^ "Deno raises $21M". deno.com. 21 June 2022. Archived from the original on 22 June 2022.