DEV Community

Cover image for Deno vs Node | Is Node.js Dead? Future of Deno 2021?
Full Stack Tutorials
Full Stack Tutorials

Posted on

Deno vs Node | Is Node.js Dead? Future of Deno 2021?

Deno is developed to overcome the Node.js Design Issues and provides a new modern development environment using ES6 etc.

Deno vs Node is a very hot topic for the discussion in developer and programmers community since Deno version 1.0 got released.

Node.js and Deno both are very similar. But the question is if we already have Node.js then what is the need for Deno. So Answers of this question is Since JavaScript has changed a lot since 2009 (when node.js was created). Now we have support for Promises, Async/Await, ES modules, Typed Arrays, and TypeScript, etc. Deno has built-in support of these new JavaScript features.

Let's understand both using the following key points.

  1. ES6 Support:
    Deno uses ES Modules as the default module system, whereas Node.js uses CommonJS.

  2. TypeScript Support:
    Deno supports TypeScript out of the box, which means that we don’t need to manually install and configure tools to write TypeScript code.

  3. Package Manager (NPM):
    In Deno, External dependencies are loaded using URLs, similar to browsers. There is also no package manager and a centralized registry like NPM - node_modules.

In short - Deno doesn't use NPM like Node.js. Deno uses modules referenced as URLs.

Deno does not use package.json.

  1. Security: In Node.js application by default has permission to system calls, environment variables, accessing files, sockets, network, etc.

In Deno application you have to provide permissions to the code for system calls, environment variables, accessing files, sockets, network, etc.

  1. Built-in Tools: Deno also provides a set of built-in tools, like a test runner, code formatter and bundler, etc.

Is NodeJS Dead?
Ans:- No

Please share your views in the comment box, Happy Coding!


Oldest comments (1)

Collapse
 
patarapolw profile image
Pacharapol Withayasakpunt • Edited

I do use TypeScript in server-side, as well as client-side browserify, so I do care about security.

However, commonjs is everywhere; even for

  • some browser-enabled modules, e.g. js-yaml
  • Most web framework CLI bootstrapping tools; React, React Native, Angular, Vue
  • Web bundling tools

This idea might increase adoption --

How to use npm module in DENO?

31

Deno is super cool. I saw it in the morning and want to migrate to deno now. I was trying to move my existing nodejs script to deno. Can any one help me on how to use npm modules in deno. I need esprima module. This one has the package…

I am trying to ask PNPM (which uses global node_modules store) maintainer on this as well.