Does Deno have what it takes to challenge Node.js? Let’s find out.

node.js web development

Is Deno a worthy rival for Node.js?

Back in 2018, Ryan Dahl, one of the original creators of Node.js, came up with a whole new JavaScript-based environment for backend development. Deno was supposed to make good on all the promises that Node.js originally fell short of keeping. The final objective was to carve out a significant chunk of the JS-for-backend market for itself. How close is Deno to achieving any of that? Let’s take a look. 

When Dahl delivered his 10 Things I Regret About Node.js speech during JSConf EU 2018, the dev community was both excited and riled up. After all, Node.js is one of the most popular and liked JavaScript-based pieces of software in the world.

In the 2020 State of Microservices from The Software House, well over 400 of 650+ experts admitted to using JavaScript/TypeScript as part of their microservices-based architecture. This JS dominance was largely the result of Node’s ubiquity across various technology stacks.

At the same time, the way Node.js monopolized the JavaScript runtime field was quite concerning to some. Especially since it does have its flaws.

What’s wrong with Nodejs?

According to Dahl, the founder of Node.js and who designed both Node.js and Deno, Node.js comes with few design issues, Deno being the answer to them. The core issues highlighted include:

  • Poorly designed and centrally distributed module system

The module system of Node.js provides developers with a way of organizing application login into modules, that is, a separate functionality required by the whole app to work. For the most part, it works quite well, but it can be confusing at times. Scoping is one of many issues that are often discussed by the community. With Deno, remote URLs are fetched and cached on the first load. You can easily load ES modules and state the URL explicitly.

  • Lack of security
  Why is the quality of software important?

Some security decisions were also criticized by the very man who helped design them. These include the fact that a Node.js-based program can access all the system calls, including the disk or network. In Deno, scripts do not have any write access to the file system, much like is the case in the JavaScript language natively.

Does Deno provide a good alternative?

OK, so Deno is correcting some of the design flows of Node.js. But is there more to it?

Yes, actually. Deno is not merely trying to be a somewhat more polished Node.js. It has its own philosophy and approach to the many challenges of writing JS code on the backend. Some of the highlights include:

  • Out-of-the-box support for TypeScript

Deno supports both JavaScript and its strongly-typed counterpart, that is, TypeScript. The latter is one of Deno’s strongest selling features. In fact, Deno is partially written in TypeScript (and Rust). The conversion of JavaScript into TypeScript is made through a combination of a built-in TypeScript compiler and the Rust-based swc library.

  • A whole new module system

Deno’s browser-centered way of managing packages by means of URLs is an easy solution to a complex issue – that’s what developers love the most. The so-called ES Modules is an ECMAScript-approved way of working with modules. The ability to import modules from both absolute and relative paths gives a lot of freedom and flexibility.

  • Single executable with no dependencies

As opposed to Node.js, Deno is distributed as a single executable file and vows to keep it that way for good. The file, when zipped, is less than 25 megabytes. All of that has a positive impact on the runtime’s performance and make it easier to get a program off the ground.

  • Built-in dependency inspector
  The Top 5 Best Free Alternatives to Photoshop

Not only does Deno explicitly take on the role of runtime and package manager, but also a dependency inspector. It will allow you to see a graphical representation of your ES modules and all of their dependencies. It makes it easy to make sense of your system without adding any overhead.

New developments at Deno

It is still quite rare to see Deno used in an actual commercial project. However, it doesn’t mean that the environment and the community around it are not growing.

The official Deno 1.0 hit the market back in May 2020. A year later, Deno partnered with Shasta Ventures, Mozilla, and some other VC firms to further develop the product and release new Deno-based commercial products. Deno Deploy is one of them. At its core, it is a simplified runtime and application deployer. It is meant to be used for serverless and stateless applications. It is a slick and modern JavaScript-based hosting offering, but it is worth it to remember that it only supports a limited number of web APIs.

What does the future hold?

So what do you think? Is Deno the long-awaited competitor of Node.js?

Honestly, at this point, it’s still hard to tell but at this stage, the good news for Deno is that it perseveres and continues to grow and branch out.

You might think that it isn’t all that much, but this highly exclusive JavaScript runtime environment club has its own rules. Node.js’s popularity and the strength of its community is such that its viability for commercial projects is just off the charts.

  The Top 7 Free Video Editing Software for Linux

Some conclusions worth noting:

  • Deno needs to pay its dues and be patient if it wants to have a shot at taking at least a chunk of its market share.
  • For now, the developers at Deno must continue polishing their library and search for new ways to monetize the core Deno.
  • The new Deno Deploy in particular has the potential to show Deno’s viability for commercial projects. It is something this product badly needs if it is to compete with something as established and loved as Node.js.
  • Deno does not necessarily stand in Node’s way. It stands apart enough, offering different ways of managing JS apps, that both can find a lot of fans. Certainly, Node.js web development is here to stay for the foreseeable future.

One thing is for sure – the future of Deno vs Node.js rivalry is still yet to be determined.

About the author: Hexa Fox

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *