Simply Explained: Deno vs Node.js
Tags: javascript, watercooler, webdev, node
Published: 2020-07-30 23:48:31

*cover photo credits - Fernando Doglio*

Most JavaScript developers are familiar with Nodejs as it is a well-established and highly-respected technology for making full-stack web applications. Nodejs is a popular open-source JavaScript runtime environment using the Chrome V8 engine. With the rise of Deno, could we possibly see a new leader in Javascript runtime?

### Table of Contents:card_index:
* [What is Deno:question:](#what)
* [Why Deno?:raising_hand:](#why)
* [Good News for TypeScript!:heart_eyes:](#type)
* [Will Deno replace Nodejs?:key:](#will)
* [Should I start learning Deno?:notebook:](#should)
* [Let me know your thoughts!:envelope:](#thoughts)
* [Thank you!:smiley:](#thanks)
 

## What is Deno:question:<a name="what"></a>

Deno is a new open-source runtime environment for JavaScript and TypeScript using the Chrome V8 engine. Just like Node, Deno utilizes event-driven architecture and asynchronous tools to build servers. Deno was founded by Ryan Duhl who is also the creator of the well-respected Nodejs. The major reason for creating Deno was that although Node is still a powerful, well-established tool for JavaScript there were still flaws about it that he wanted to address. He explained this at the JSConf EU in 2018. Watch the video below to learn more about the issues of Node:point_down:.

{% youtube M3BM9TB-8yA %}

## Why Deno?:raising_hand:<a name="why"></a>

Under the hood, the major difference between Node and Deno is that Node was written on C++ as Deno was written in Rust. This provides Deno with a more strict validating procedure and is memory-safe compared to Node. Deno uses ES Modules as the default module system, whereas Nodejs uses CommonJS. With Deno, the dependencies are loaded using URLs which defeats the need for package manager or centralized registry(you heard me!:loudspeaker: No package.json!:scream:) and comes with built-in utilities such as a code formatter while you would need to install dependencies for Node.

![Example of imports with Deno and Node](https://dev-to-uploads.s3.amazonaws.com/i/zx9luia3rlnjc5le9mof.png)

### Good News for TypeScript!:heart_eyes:<a name="type"></a>

A big difference with Deno is that access needs to be explicitly granted which means better security. **Because of this, Deno will run TypeScript right out-the-box(first-class)!** This is a huge benefit as with Node you would need to install and configure the necessary tools:wrench: needed to write in TypeScript.

## Will Deno replace Nodejs?:key:<a name="will"></a>

The short answer to this is not right now. Currently, Node is a well-established runtime that will be highly used for many years to come. Although Deno has a lot of potential to be the top technology for web applications, It is only in version 1.2.1 while Node is in version 14.7.0 as of July 29, 2020. Deno will be in development for a few years before it has enough features to be a competitor of Nodejs.:calendar: The biggest disadvantage is that Deno does not support most third-party modules. As of 07/30/2020, there are 799 supported third-party modules. [:bookmark: Click here for the current list of supported packages](https://deno.land/x).

## Should I start learning Deno?:notebook:<a name="should"></a>

For beginners, I recommend learning Nodejs. Node is still highly-used for many companies and projects with only a handful of companies utilizing Deno. While Deno's third-party modules library:closed_book: is steadily growing, Node has a large list of modules ready-to-go for your next project. For experienced developers, this is your chance to be an early adopter of a highly-anticipated technology. It will serve a great benefit to show employers that you have been using Deno for some projects since version 1.0.0 has been released(at least until you find the *"Must have 10 years of experience in Deno"* job listings when Deno has only been out for five years:confused:). 

## Let me know your thoughts!:envelope:<a name="thoughts"></a>

Are you currently exploring Deno? Do you think Deno will replace Node? If so, when you think Deno will be ready to replace Node? Comment down below your thoughts or mention what I left out about Deno or Node. 

## Thank you!:smiley:<a name="thanks"></a>

If this article provided any value to you, please leave a :heart: or let me know your thoughts! Follow me to keep up when I post more articles as I will be posting five days a week until further notice. I might continue the new series of "Simply Explained" topics. Let me know what other topics I can simply explain to you!

{% user mrshawnhum %}