My opinion about Deno vs Node.js ?

Top Deno Features:

  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?

--

--

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