loading...
Cover image for What is Deno? Is it gonna replace Node?

What is Deno? Is it gonna replace Node?

vikrantbhat profile image Vikrant Bhat ・3 min read

Version 1 of Deno was released on 13 May 2020, but what
does that mean for you? Is it gonna replace Node? Is
all of the hard work that you spent learning node completely wasted? Let’s find out!


Deno is a new runtime for javascript. So think about Denoas an upgraded newer version of node.js. Also interestingly it is created by the exact same person who created node.js — Ryan Dahl

Ryan saw all of the problems with node and the poor design decisions he made during the development but since now millions of Softwares depend on it, it is impossible to make amends to the legacy code. Hence he decided to recreate node.js in a better form and thus Deno was born.

Fun Fact Deno is actually an anagram of Node. Cool right!?

Check out the video below where Ryan shares his regrets about node.js and why he is building Deno.

Bottomline — Deno is a new runtime that is built on Rust, which is going to be very similar to node and do a lot of things that node does but with a lot of advantages.

One of the biggest advantages that Deno has over node is that it has built-inTypeScript support! So if you are someone who uses TypeScript when you write JavaScript, you can just use it out of the box with Deno, since it has the compiler and everything built-in, so you don’t have to worry about any
TypeScript configuration!

Now allow me to blow your mind in the following two points:

  1. A Deno project doesn’t need node_modules to keep 3rd party code.
  2. A Deno project doesn’t need a package.json to manage your dependencies.


A popular meme, comparing the weight of node_modules 😂

Amazing right? Now your next question would be then how do we use 3rd party libraries in Deno?

The following line shows the syntax of how you will be importing libraries in Deno.

import { serve } from “https://deno.land/std@0.50.0/http/server.ts";

That’s right! We will be importing libraries directly from the server! (using the URL) and during the first compilation, the imported library will be cached in your computer so that the subsequent compilations are faster.

All of your dependencies are saved in a central location on your computer, so you don’t have to worry about this massive node_modules folder.

This completely eliminates the use of a package manager like NPM.



https://deno.land/

As soon as you land on Deno’s website the first thing you see is their tagline:

A secure runtime for JavaScript and TypeScript.

And this brings me to the next important feature of Deno. Deno is secure by default. By default, I mean that a Deno project has no permissions by default.
You have to provide permissions explicitly for each and every resource that you want Deno to use. For example, even just to start a server on your local machine you have to provide permissions! This means Deno cannot access anything in your machine until you explicitly tell it to.


So is Deno gonna replace Node?

Well, I have to say right now, that is not going to be the case. While Deno is really cool and it has a lot of new features coming to it, it still is in a very early phase, it just hit v1 recently. Deno is still working on a lot of things, for example, the browser compatibility is still not 100%, they are still working on the browser APIs, and it will take them some time to achieve this.

Also, when I mentioned that we don’t use NPM with Deno, that is actually a little bit of a downside right now. Javascript is based around the NPM packages and the downside is that many of these packages are not going to be compatible with Deno right away.

Surely over a certain period of time, people will start writing packages compatible with Deno, but at the time of publishing this article that is not the case.


Thank you for reading the article! I hope that now you have the basic understanding of what Deno is.
You can follow me on twitter to get updates as soon as I post a new article or just tweet me your thoughts! Seeya!

Posted on May 30 by:

vikrantbhat profile

Vikrant Bhat

@vikrantbhat

The irony is, I am a web developer but I am shit scared of spiders. Javascript && React ⚛️

Discussion

markdown guide
 

Like it is mentioned already, Deno is too weak to compete Node at the moment. Its not that battle-tested and it will not be any time soon.

So far I like the Deno concept and the approach on the security side.

 

Yeaa, it will be like birdwatching for a while, until it starts getting some serious traction!

 

To me it seems that those "bad decisions" that Ryan regrets while he was designing Node.js are a tad overblown. I mean, I've seen the list of "huge improvements" of Deno compared to Node but I have to say I'm underwhelmed.

At its core Deno is still V8, so performance is probably identical to Node ... then we're throwing away the complete ecosystem around Node.js (as you rightly say, the lack of npm and package.json isn't really a pro, rather a con), plus the need to relearn everything.

So I'd say this does not look like the "revolution" we've been waiting for. It's cool as a toy to play around with and maybe for a few non-critical and small "greenfield" projects, but beyond that I'd say let it mature for a few years and then we'll see again.

 

True, I agree with you! It all makes sense if we see the bigger picture. Deno is essentially node with tiny bit improvements, but things like not supporting NPM libraries at the moment are hinderance to using them right now in 2020.

 

Right ... it's an evolution, not a revolution.

 

Deno seems to have nice improvements above node.js, Lets see if it replaces node.

 

Deno is in very early stages, I think atleast 5-6 years until deno becomes mainstream, Node is being used everywhere. It will take time for sure!

 
 

There's so much talk about Deno rn! Nice to hear another perspective. Great opinion piece vikrant😊

 

Hey! Thanks for the read, the hype for Deno is real. Lets see how it turns out to be 😁

 

Of course! And it sure is. Yes, Let's 🙌