What is Deno?
Differences between NodeJS and Deno
- Issues with its module system, with centralized distribution (npm)
- Lots of legacy APIs that must be supported
- Lack of security model :(
- An explosion of tooling (grunt, gulp, webpack, babel, parcel, typescript, ts-node and so on and so on...)
Now we see a few problems that pushed authors to create Deno. The key differences between these two technologies are:
- Deno uses ES modules as a default module system
- Deno has got build in dependency manager. There is no reason to use npm.
- Deno supports TypeScript by default
- Deno's API was redesigned to using Promises and key features known from ECMAScript 6 and TypeScript
- Deno has got its own BCL (Base Class Library)
- Deno uses url to get dependencies both local and from third party sources
Another interesting topic is security. As I mentioned before NodeJS has no security model. Deno by default does not allow programs to get access to files, network, subprocesses and environment variables. For example, if we want to allow our server to write files, we need to manually set access from the terminal.
deno install --allow-net --allow-read file_server https://deno.land/std/http/file_server.ts
All of this leads to the conclusion that Deno technology is worth to observe. Planned release date of the first stable version is the beginning of 2021 (January). Deno solves many NodeJS problems and it looks like it is going to have better performance. The concept of security model and BCL is really good. Who knows, maybe Deno will be the next NodeJS.
Link to tech talk about deno on dotJS 2019: https://www.youtube.com/watch?v=lcoU9jtsK24