What is Deno?

If you like NodeJS but not its package manager npm, or you want a more secure JavaScript runtime environment than Node.js, you might find the new open source project Deno of interest (the word Deno is an anagram of Node). On the other hand, if you’re using Node.js in production, there’s nothing to see here, move along – Deno is still “very much under development.”

Deno is a program for running JavaScript and TypeScript code outside of a browser. It’s the most recent effort spearheaded by Ryan Dahl, who founded the Node.js project in 2009, and it is an attempt to reimagine Node.js in light of the advances in JavaScript since 2009, including the TypeScript compiler. Like Node.js, Deno is essentially a shell around the Google V8 JavaScript engine, although unlike Node.js it includes the TypeScript compiler in its executable image.

What is NodeJS?
Scalability, latency, and throughput are key performance indicators for web servers. Keeping the latency low and the throughput high while scaling up and out is not easy. Node.js is a JavaScript runtime environment that achieves low latency and high throughput by taking a “non-blocking” approach to…

Deno and advanced JavaScript

In 2009, JavaScript lacked several features that would have been useful for Node.js, according to Dahl. A few of these have been added to JavaScript over the years as part of the ECMAScript (ES) standard, and TypeScript has addressed a few more.

JavaScript has had events and callbacks essentially forever, but they can lead to rather complicated code, especially when you want to chain asynchronous actions. Promises make the syntax a bit more readable. A promise is a returned object representing the eventual completion or failure of an asynchronous operation, to which you can attach callbacks, as opposed to passing callbacks into a function. Declaring a function async further simplifies the syntax, allowing you to use await within the function to pause in a non-blocking way until the promise settles.

When Node.js was created, the de facto standard for JavaScript modules was CommonJS, which is what npm supports. Since then the ECMAScript committee officially blessed a different standard, ES Modules, which is what jspm supports. Deno supports ES Modules.

What is TypeScript?
TypeScript is a variation of the popular JavaScript programming language that adds some key features that are important for enterprise development. In particular, TypeScript is strongly typed — that is, variables and other data structures can be declared to be of a specific type, like a string or a…

Typed arrays are an ES6 API for handling binary data, something Node.js could have used; the lack of binary data support led to some Node.js design issues. Deno uses typed arrays when it needs to manipulate raw binary data. Node.js now supports typed arrays for user code.