Last Updated On By Khizer Ali
Deno is in the limelight since its release on 13 May 2020 by Ryan Dahl, the same person who created Node.js.
He introduced Deno because there were several things which he regrets about Node.js and he made it public in its JSConf Conference which was held in 2018.
Table of Contents
Deno is a new JavaScript runtime based on JavaScript V8 engine and written in Rust programming language.
Deno is like a new implementation of Node.js with all the improvements which Ryan Dahl considered as regret about Node.js.
Many questions arrived soon after the release of Deno. For Example Will Node.js be replaced, Will Node.js finish etc. So what is the answer to all these questions?
But, before that, let’s discuss those features and advancements of Deno as compared to Node.js due to which people are having these questions in their mind.
In Node.js if you launch an application, then this will have direct access to your network, computer, system calls and files. So the runtime should have some restriction.
In Deno, they mention about security quite high lightly. We can work securely in Deno environment with the help of security flags. When you are going to work on actual projects, you are going to realize that there are many security flags and a whole lot of community appreciates it.
Deno does something behind the scene which does not allow any code or any application directly run into that. Deno executes the code inside a Sandbox which forces you to pass certain flags for different permissions explicitly.
There are various flags available like giving access to the internet, creating a file, read some data from a file and some other permissions like that.
For example:
If you want to allow network access to your application, you have to run your application like below:
deno run --allow-net app.js
In the modern world where security is so much concern, I appreciate that Deno was created by keeping security in mind from the very first day.
In Node.js, we use NPM (Node Package Manager) to download different packages and third-party libraries and their dependencies into our application.
In Deno, there is no package manager. NPM is no longer there, so it means that all the things which we used to have in Node.js like the node module folder which is gigantic are also not there in Deno. Instead Deno uses modern ES6 syntax like below
import { serve } from "https://deno.land/std/http/server.ts";
Deno provides you a support of TypeScript, which means you can directly code in TypeScript without configuring your environment. Isn’t it cool? Because TypeScript is a superset of JavaScript, it speeds up your development without additional tooling.
No doubt that Deno overcomes several short comings of Node.js and result in a better platform than Node.js.
However it does not mean that Node.js will not survive. Yes, Node.js is not going anywhere.
To prove my point, let’s go back to 2009 when Node.js was released.
At that time, many developers thought and debate that PHP will not be going to survive after Node.js. But see, it has been more than a decade, but still, PHP is working well in the market.
There are a vast number of developers and companies which are using Node.js right now. The top four products of Node.js, which are ruling the market are Netflix, LinkedIn, Paypal and Uber. These applications have millions of users across the globe.
So the companies will not try to switch their products from Node.js to Deno. Let’s assume for a second that Uber wants to convert their application, During the current situation of pandemic and COVID-19 in the whole world, Would they able to take this risk even after bearing billion dollars loss? The answer is a big NO. No one will dare to take this chance.
Although Deno has become a centre of attraction among all the programmers and developers after its release, it doesn’t mean that it will completely take over Node.js. In the coming years, it may conquer the market, but still, Node.js will have its place.