Let’s meet Deno the Dinosaur 🦕

Let’s meet Deno the Dinosaur 🦕

Hey geeky folks, In recent days you might have heard the word ‘Deno’.

What is Deno?

Deno is the JavaScript runtime just like node.js and deno actually is created by the same person Ryan Dahl as node.js was. Deno comes into the picture to fix some of the flaws of node.js. In this article, we are going to find out which flaws and fixes that are and how deno works

You could say that deno is the replacement for node.js not a replacement in the sense of should replace node.js with it. You could look into deno because it might be able to do the same thing in a better way. However, deno is at an early stage.

Features of Deno

  • Deno out of the box does not only support javascript but it also supports typescript with no need for manual compilation.

  • In deno, you don’t import something from a magical HTTP module and you also don’t need to do npm install to import from the node modules folder instead with deno import from the webserver, you import from URL. Eg: import {server} from 'deno.land/std@0.50.5/http/server.ts'

  • Thereafter we get another new set of feature deno embraces modern javascript features like a promise or async iterables.

  • It is essentially a for loop that allows you go through an infinite array you could say an infinite array of incoming data and events

  • This is another feature of deno we can use top-level await and just when you use it with async iterable but also on plane vanilla promies

  • In node.js any script is able to spin up a web server or to work with your file system and there’s little you can do about that. Now if you’re writing your own node code which you run on your own machine that’s not necessary but if you installing third party packages.

  • With deno, you control which permission you give to your scripts when you execute them. By default, there is no permission.

Will it replace node.js

Keeping in the mind that node.js is getting used by lots of huge company out there. Tons of projects and package built-in node.js.it is not brand-new runtime so, I think node.js is not going anywhere.

Deno which is alternative to node.js. It's very immature, very new. It will have bugs. It is worth pointing out that the deno team promised to maintain a stable API in deno.

Nonetheless, deno definitely might not be the right choice for everyone not yet. Simply because it's new.

Currently, deno is not compatible with npm packages and that's of course big bummer. That might change over the period of time.

Final words

With all that summed up, deno might still nice to dive in right now to play around with it and start building some side projects and simply experiment with it. Node.js is not going anywhere. Node.js has been around for such a long time and it has a huge ecosystem. It is used by a lot of companies but deno might play an important role in future.

If you find useful share with your friends 😉. You can also connect me on Twitter or LinkedIn.