The new JavaScript & Typescript Runtime

Thew new Runtime for JavaScript and TypeScript

Someone is always trying to make the next big thing. Ambition, to be the best, to be the creator, to find the next new thing. Deno a platform for building new apps with Javascript and TypeScript is that, it’s a new attempt.

The man behind the soar.

Ryan Dahl is the original creator of Node.js , and Deno is his solution to everything that he felt Node.js lacked. The first time he mentioned his solution, Deno was in 2018, during his talk “What i regret about Deno”. Rome was not built in a day and neither was Deno. After two years of continuous work, his project was ready. On May 13,2020 Deno 1.0 was finally released. He wanted to replace Node.js, it had everything Node.js lacked, Deno promised high security, patching to bugs Node.js did not address and an overall better experience.

Why would the creator of Node.js be creating a completely different platform and not just addressing Node.js issues themselves. I doubt anybody knows Node.js better than Ryan himself. He states and i quote “Considering the vast changes in the landscape of JavaScript and the surrounding software infrastructure, building Node projects became an arduous endeavor. It was worthwhile to simplify it.”

He can handle the issues, but this can lead to so much more. In a simple and wide ranged environment Deno can do all that Node can do and better. Simplicity is the key but can it really deliver?

The idea

Ive mentioned it a couple of times now , but have not gone int detail.What is Deno?

Deno is a simple, modern runtime for JavaScript and TypeScript that is based on the V8 engine and the Rust programming language. Fully compatible with the existing Node.js and has what Node.js lacks.

  1. Secure by default. No file, network, or environment access, unless explicitly enabled.
  2. Supports TypeScript out of the box.
  3. Ships only a single executable file.
  4. Has built-in utilities like a dependency inspector (deno info) and a code formatter (deno fmt).
  5. Has a set of reviewed (audited) standard modules that are guaranteed to work with Deno: deno.land/std

Feature’s

Integrated Security:

Deno does not allow access on the whim. It keeps you from risks with is stricter permission requests and granting. To gain access to its filesystem, environment variables or network you would have to use command-line arguments to enable this access.

If you want to get access to the ‘xyz’ folder, use the command-

deno — allow-read=/xyz myscript.ts

This command only allows you to read. In order to write you would have to use a completely different command and gain permission.Its like installing a new app, it may asks for permission to access your location, contacts, photos. The same notion applies.

Stability:

Maintaining a stable API, any feature and module not ready for stabilization is hidden behind an unstable command line flag. You can still use these unstable API’s during runtime but it also means that they have no undergone a security check and are not ready.

Library:

Deno claims to have a complete library. Allowing developers to perform basic tasks and taking on complex ones with external libraries.

Installation

Deno ships as a single executable with no dependencies. You can install it using the installers below, or download a release binary from the releases page.

Shell (Mac, Linux):

$curl -fsSL https://deno.land/x/install/install.sh | sh

PowerShell (Windows):

$iwr https://deno.land/x/install/install.ps1 -useb | iex

Homebrew (Mac):

$brew install deno

Chocolatey (Windows):

$choco install deno

Scoop (Windows):

$scoop install deno

Build and install from source using Cargo:

$cargo install deno --locked

See deno_install for more installation options.

Deno vs Node.js

All platforms have their own purpose. However Deno and Node’s purpose are the same, yet the mechanisms behind them differ. You could even refer to Deno as the extended version of Node.Both are event driven and have asynchronous tools . Te major difference lie in the following

  • Cores: Node’s was written in C++, while Deno’s written in Rust.
  • Unlike Node, Deno uses URLs or file paths to load third-party modules and external dependencies instead of npm
  • While Node uses CommonJS as the default module system, Deno uses ES modules.
  • There is no registry or package.json in Deno. Modules can be hosted everywhere on the internet.
  • Deno needs explicit permissions to get access to files, networks, and environment variables, which means better security.
  • Differing from Node, Deno executes the code by-default in a sandbox which means it has no access to the file system, network, environment variables.

Is Deno soaring past Node.js?

Honestly nobody knows.As of this moment the answer is clearly No. Deno can not replace Node, not yet.Deno id more than simply a modified version of Node.js , it its own platform a completely different implementation. But it is definitely beginning to compete.

Not yet

The excitement behind it like with every new innovation is high.It is still new and still growing, its first version was released publicly just over a year ago.It has unique feature and potential. The future welcome Deno with open arms, a fun , better and more stable environment is not something developers would shy away from. Who knows, Deno might just soar to new heights.

Full Stack Software Engineer || Entrepreneur at heart , engineer by training. Comedian in the eyes off my peers.

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