Return to blog

Can Deno replace NodeJS?

hero image for Can Deno replace NodeJS?

Nowadays JavaScript is the most popular technology. You can write desktop apps, well designed websites or even fast and efficient backends. Let's focus on backend. The most popular backend framework is NodeJS. Its creator, Ryan Dahl, quit this project and teamed up with Bert Belder in 2017. They wanted to create machine learning framework written in JavaScript but Google outran them with TensorFlow.js. They were unsatisfied about how the NodeJS is working and aware of problems with this technology. That is how the idea of Deno was born.

What is Deno?

Deno is a runtime environment built around JavaScript V8 engine for JavaScript and TypeScript. Its name came up as an anagram of node. Deno has been created in Rust programming language. In the first version authors used Golang but they needed a better garbage collector, higher speed and efficiency, so they choosed Rust. Let's think about whether Deno is worth attention. Why should we keep an eye on it?

Differences between NodeJS and Deno

Since 2009, when NodeJS was created, JavaScript and the web have changed significantly. Consequently NodeJS suffers for some major problems:

  • Issues with its module system, with centralized distribution (npm)
  • Lots of legacy APIs that must be supported
  • Lack of security model :(
  • An explosion of tooling (grunt, gulp, webpack, babel, parcel, typescript, ts-node and so on and so on...)

Now we see a few problems that pushed authors to create Deno. The key differences between these two technologies are:

  • Deno uses ES modules as a default module system
  • Deno has got build in dependency manager. There is no reason to use npm.
  • Deno supports TypeScript by default
  • Deno's API was redesigned to using Promises and key features known from ECMAScript 6 and TypeScript
  • Deno has got its own BCL (Base Class Library)
  • Deno uses url to get dependencies both local and from third party sources

Another interesting topic is security. As I mentioned before NodeJS has no security model. Deno by default does not allow programs to get access to files, network, subprocesses and environment variables. For example, if we want to allow our server to write files, we need to manually set access from the terminal.

deno install --allow-net --allow-read file_server https://deno.land/std/http/file_server.ts

All of this leads to the conclusion that Deno technology is worth to observe. Planned release date of the first stable version is the beginning of 2021 (January). Deno solves many NodeJS problems and it looks like it is going to have better performance. The concept of security model and BCL is really good. Who knows, maybe Deno will be the next NodeJS.

Link to tech talk about deno on dotJS 2019: https://www.youtube.com/watch?v=lcoU9jtsK24

As a reliable software company we’re focused on delivering the best quality IT services. However, we’ve discovered that programming skills give us a very particular opportunity...

.eco profile for codetain.eco

Reach Us

65-392 Zielona Góra, Poland

Botaniczna 70

© 2015-2024 Codetain. All rights reserved.

cnlogo