Within the Javascript ecosystem there is a recurring joke that says that every so often a new framework or Javascript library, so it is impossible to know how many libraries or frameworks exist in this language. For several years now, we have seen how there is an interest not only in new frameworks, but also in new runtime environments that aspire to compete with NodeJS, the most widely used runtime environment in the Javascript ecosystem, not only for backend development, but also for desktop applications.
Currently two of the most popular alternatives to NodeJS are Deno y Bun. We will first explain the common characteristics and then go into each one in more detail.
What do they have in common?
Both execution environments share the following characteristics:
- All in one: Both have linter, code formatters, testing... integrated within the execution environment itself, without the need to install external libraries.
- Native Typescript support.
- Standard Web APIs.
Both runtime environments boast improved NodeJS execution speed and are backwards compatible with NodeJS and npm.
Deno

Deno was created in 2018 by Ryan Dahl, the creator of NodeJS, with the idea of improving the bugs that, according to Dahl himself, NodeJS had and that he had not been able to fix when he conceived it. Deno is developed using V8 as the Javascript engine, the Rust programming language and the Tokio framework.
To install Deno on your macOS or Linux system use the following command:
If we use macOS we can install it using Homebrew
One of the most significant features of Deno is that it is «secure by default». Deno restricts access to sensitive aspects of the application such as access to the file system or environment variables unless we tell it otherwise. For example, if we want to give network access to accept connections we have the -allow-net option.
Dependency management is also one of the most unique features of Deno: instead of a package.json where all application dependencies will be managed, in Deno dependencies are managed directly with URLs, allowing to import a dependency with a URL without having a node_modules directory directly in the file to be used by the dependency.
This feature can generate a problem, and it is that if we need that dependency in different modules of the application we can use different versions of the same dependency if we are not careful when adding it. To solve this problem different methodologies are proposed, from creating a separate file with all the dependencies to have them centralized to the use of a configuration file deno.json where we will put all the dependencies. imports.
Deno is community maintained and open source. An example of a framework which uses Deno as its runtime environment is Fresh, a framework web with Server Side Rendering.
Bun

Designed by Jarred Sumner and with version 1.0 released on September 8, 2023, its main objective is to improve execution times without the need to learn new methodologies and using the usual APIs of the Javascript ecosystem. It is developed in Zig.
Bun focuses on improving the performance and execution speed of applications while maintaining many of Node's features. Node modules such as fs, path, or the node_modules directory to manage dependencies, can still be used in Bun. To install Bun on macOS or Linux you have to execute the following command:
To check that it has been installed correctly we can run a command to check the current version.
Dependencies are handled in a very similar way to Node. Instead of using npm to manage dependencies, we use bun directly. In case it is a Node dependency it will be added to node_modules.
Bun supports both CommonJS and ESM for module management, so we can import both NodeJS and Bun modules. In this case we are going to import Elysia, a framework alternative to Express that takes advantage of Bun's features.
Conclusions
Deno and Bun are presented as alternatives to Node with the aim of improving application performance as well as solving security issues present in NodeJS. The appearance of both execution environments has generated great expectation in the Javascript ecosystem, and although these environments are not mature enough to be used in production, the features they offer contribute to present a competition to NodeJS interesting enough for NodeJS to improve, as well as to change the paradigms to which we are accustomed in the Javascript ecosystem.

