My opinion about Deno vs Node.js ?

You can find everything you want to know about Deno, here at deno.land which is its official website.

In this story, we will cover the main difference between both Deno and Node.

Just like node, deno is also built on the V8 engine, and Rust programming language. But if we have node why we need Deno. Well, JavaScript has changed a lot since 2009(when node was created), really a lot. We have support for Promises, async/await, ES modules, typed arrays, and TypeScript is also very popular now.

NodeJS, design wise, architecture wise is more like any other backend programming language and not like JavaScript where things like importing a script is as simple as using the <script> tag and specifying the URL of the script, although module systems are good, but they are too strict and bulky. And in Node, we have a centralized distribution for these modules, which again is kind of a restriction.

And Node is less secure.

Top Deno Features:

The following are some of the top features of Deno.

  1. It’s secure. An application written in Node gets permission to system calls, environment variables, accessing files, sockets, network by default. Whereas deno its permission driven so to access disk, network, subprocesses or environment variables, you have to provide permissions to the code which is like --allowed-read, --allowed-write, --allowed-net for networking, --allowed-env for accessing environment variables and so on.
  2. It supports Typescript and has an inbuilt Typescript compiler.
  3. Node was created in 2009, and since then many new JS features have been introduced like ES modules, Promise, Async, Await, etc, which are supported in Deno.
  4. Improved module system, which is more generic with import statements, and we can use URLs in code to import any module directly using the URL in the code, and at runtime the module is downloaded and cached for future. With this __node_modules and index.js are gone. For those who do not know about node, when we use a module, which is like a readymade code which can be used directly in the code like for image compression, or http module, etc. the node_modules folder in your project directory gets the module downloaded in it and the execution defaults from index.js, but not anymore.
  5. It doesn’t use npm and no package.json file for defining dependencies.
  6. GYP Build System (used to compile C library and link it to Node if you need any C native library, useful if you are developing some module in Node) is used in Node. It doesn’t affect us as developers but there are better builder systems available now.
  7. Uses V8 snapshots, which makes compilation and code incredibly run fast.
  8. It supports Browser APIs to like unload, on unload, location, setTimeout, etc. (why we need this if the code is server-side)
  9. We can even run URLs using the demo command for example, deno https://deno.land/welcome.ts and yes everything you run or import on your code must have the extension specified .js or .ts
  10. It comes pre-loaded with many tools are present in deno like deno install, deno info(dependency inspector), deno fetch, deno fmt(for code formatting), etc.

Is NodeJS Dead?

Well absolutely No! Deno sounds like a better version of Node, but it’s still too early to say this.

Deno is too young and Node is too stable.

NodeJs is used by many big companies like Netflix, PayPal, etc, it has a large community, it is stable runtime and is a great choice to develop an application. It is possible that in the coming time when more and more developers adopt deno, that we will get to know about how stable deno framework is or how the developer community builds around it, etc.

So if you are beginner, and in doubt, what to learn? I would suggest go for Node, as it is still a great platform but do keep an eye on deno framework too.

--

--

--

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Top 10 Free Courses to learn Angular Framework in 2022

10 best free Angular courses for Beginners

Concept of Scoping in JavaScript

Why you should consider using a static site generator

How To Deploy Your Nuxt.js Application with Vercel

.gitignore mistake that everyone makes

JavaScript: debug yourself

How to Build a WhatsApp Bot for Your Business Without any Coding

How to Implement Memoization from Scratch

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Zache Leto

Zache Leto

More from Medium

JavaScript Class Field Declarations

Introduction to Application Development: Client Layer

How I Deploy my Projects in 2022

Create a nest js project from scratch (manually)

Learn Nest Js