cover photo credits - Fernando Doglio
Most JavaScript developers are familiar with Nodejs as it is a well-established and highly-respected technology for making full-stack web applications. Nodejs is a popular open-source JavaScript runtime environment using the Chrome V8 engine. With the rise of Deno, could we possibly see a new leader in Javascript runtime?
Table of Contentsπ
- What is Denoβ
- Why Deno?π
- Good News for TypeScript!π
- Will Deno replace Nodejs?π
- Should I start learning Deno?π
- Let me know your thoughts!βοΈ
- Thank you!π
What is Denoβ
Deno is a new open-source runtime environment for JavaScript and TypeScript using the Chrome V8 engine. Just like Node, Deno utilizes event-driven architecture and asynchronous tools to build servers. Deno was founded by Ryan Duhl who is also the creator of the well-respected Nodejs. The major reason for creating Deno was that although Node is still a powerful, well-established tool for JavaScript there were still flaws about it that he wanted to address. He explained this at the JSConf EU in 2018. Watch the video below to learn more about the issues of Nodeπ.
Why Deno?π
Under the hood, the major difference between Node and Deno is that Node was written on C++ as Deno was written in Rust. This provides Deno with a more strict validating procedure and is memory-safe compared to Node. Deno uses ES Modules as the default module system, whereas Nodejs uses CommonJS. With Deno, the dependencies are loaded using URLs which defeats the need for package manager or centralized registry(you heard me!π’ No package.json!π±) and comes with built-in utilities such as a code formatter while you would need to install dependencies for Node.
Good News for TypeScript!π
A big difference with Deno is that access needs to be explicitly granted which means better security. Because of this, Deno will run TypeScript right out-the-box(first-class)! This is a huge benefit as with Node you would need to install and configure the necessary toolsπ§ needed to write in TypeScript.
Will Deno replace Nodejs?π
The short answer to this is not right now. Currently, Node is a well-established runtime that will be highly used for many years to come. Although Deno has a lot of potential to be the top technology for web applications, It is only in version 1.2.1 while Node is in version 14.7.0 as of July 29, 2020. Deno will be in development for a few years before it has enough features to be a competitor of Nodejs.π The biggest disadvantage is that Deno does not support most third-party modules. As of 07/30/2020, there are 799 supported third-party modules. π Click here for the current list of supported packages.
Should I start learning Deno?π
For beginners, I recommend learning Nodejs. Node is still highly-used for many companies and projects with only a handful of companies utilizing Deno. While Deno's third-party modules libraryπ is steadily growing, Node has a large list of modules ready-to-go for your next project. For experienced developers, this is your chance to be an early adopter of a highly-anticipated technology. It will serve a great benefit to show employers that you have been using Deno for some projects since version 1.0.0 has been released(at least until you find the "Must have 10 years of experience in Deno" job listings when Deno has only been out for five yearsπ).
Let me know your thoughts!βοΈ
Are you currently exploring Deno? Do you think Deno will replace Node? If so, when you think Deno will be ready to replace Node? Comment down below your thoughts or mention what I left out about Deno or Node.
Thank you!π
If this article provided any value to you, please leave a β€οΈ or let me know your thoughts! Follow me to keep up when I post more articles as I will be posting five days a week until further notice. I might continue the new series of "Simply Explained" topics. Let me know what other topics I can simply explain to you!
Top comments (11)
I love the idea of deno because it brings web js and server is a lot closer together. Granted, you can't natively import typescript on the web, but it would be possible to have a service worker transpile the ts to js on the fly, making it work like deno.
Hey! Nice article. You beautifully explained the topic. As a beginner, it often gets confusing whenever we hear a new name! Thank you for sharing. π
I am glad! I might continue to do this where I try to explain a topic as simple as I can. It has always been confusing for me in the beginning.
That will be awesome! π
Thanks Sir ,It was really helpful!!
I am glad it was! Thank you!
I Love node
So do I!
If you want the deno experience for the web or you want to port node modules to deno, I am working on:
adam-cyclones / didi
Convert a project from common JS to ESmodules, with included bundler-like / task runner behaviour.
didi
A transpiler for JavaScript and Typescript, transforming CommonJS modules into distinct ES Modules
Who uses didi?
Frontend and deno developers will find didi useful.
Try it out.
didi is not ready for production however you can still take didi for a spin!
npm install -g @didi-js/client-didi-cli # or yarn global add @didi-js/client-didi-cli
Create a project an entry file, some installed node_modules and then require the browser dependency into your entry file using the base specifier.
run
didi path/to/example-project
The result should have output a new target directory within this example-project and also a server should have started on
http://localhost:8086
. You may see some console errors in the browser, this is normal for this stage.You may also notice that your import looks like this:
All the more reason to learn and use TypeScript in future projects. Looking forward to when Deno becomes more stable.
Can't wait to get into Typescript!