I’ve been spending a lot of time exploring new tech, trying to make out the most of the Lockdown. From Vue & VueX to Service workers & IndexedDB, it has been a great journey so far. For a few days, there has been a lot of buzz in the engineering community around Deno (I pronounce it as Dee-no), a secure JavaScript & Typescript runtime developed by Ryan Dahl, who previously developed Node.js back in May 2009.

I am working on Node.js for over three years now, and hence, I wanted to explore Deno since it’s very similar to Node and wanted to understand how is it different from Node, and is it any better? At the time of writing this article, Deno announced the 1.0.0 release.

So what is Deno?

Deno is a new runtime for Typescript (and Javascript), a part of it is written in Rust. As Ryan Dahl said in one of his interviews, that Deno acts more like a web browser for command-line scripts. Its security model is that to a browser where websites ask for permission to access the camera, location, etc.

Deno aims to replace utility scripts that were historically written with Bash or Python.

Similarly, Deno scripts run in a secure sandbox without access to the operating system, where users can selectively grant access to the files to provide further functionality. Furthermore, it explicitly takes on the role of both runtime and the package manager.

Features of Deno and how are they different from Node.js

If you’ve worked with Node.js previously, you’ll find Deno quite similar to it but with some significant enhancements around security and the way we import the modules.

Here are some of the features I tried out using Deno and I am highlighting some of them below:

  • Deno is written in Rust as compared to its predecessor, Node.js, which is written in C++.
  • Unlike Node.js, it does not use npm and instead uses modules that are referenced as URLs or file paths. It also embraces the use of ES6 Modules over require statements.

#deno #node #javascript #typescript #web-development

Getting started with Deno.js
1.95 GEEK