FAQs about Deno

Mayank C
Tech Tonic

--

In this article, we’ll go over five most commonly asked questions about Deno. We’ll start with basic questions in this article, followed by more advanced FAQs in following articles.

What is Deno?

In simple words, Deno is a server-side JS runtime like the extremely popular Node.js. In fact, Deno’s name comes from Node by rearranging the letters (why? we’ll see it in the next question).

The official definition of Deno is:

Deno (/ˈdiːnoʊ/, pronounced dee-no) is a JavaScript, TypeScript, and WebAssembly runtime with secure defaults and a great developer experience. It’s built on V8, Rust, and Tokio.

Deno allows running TS/JS applications on the server-side. The purpose of Deno can be summarized in three bullets:

  • Support TS/WASM out of the box
  • Run application securely in a sandbox
  • Better DX (developer experience)

The last bullet (developer experience) is provided through a series of sub-features like built-in code formatter, documenter, linter, test runner, auto completions, LISP, etc.

Again, in short, Deno is like a modern upgrade over Node.js.

Why was Deno created, and who’s behind it?

This is a great question. It always helps to know the history behind something.

Deno was born in 2018 from Ryan Dahl’s famous talk on his regrets about Node.js. If you have used Node.js, you surely would have heard about the one and only Ryan Dahl. He is the same person who had also invented the incredibly popular JS runtime, Node.js. In the 26-minute video, Ryan went over the 10 things he regretted about Node.js. The regrets were like: NPM control, no promises, no sandboxing, etc. In fact, NPM was the reason why Ryan had to move out of Node.js. The talk paved the way to a brand-new modern runtime called Deno, which would fix all the ‘regrets’. Finally, i.e. after 10 years of Node’s first release, there was someone who might be able to challenge Node.js’s crown.

Technical reasons were one part of the picture. Political reasons were other. Although Ryan was the inventor of Node.js, he had to leave the Node.js project after 3–4 years, because of the continuous tussle between Ryan and the founder of NPM. Apparently, NPM became too powerful. That surely was a bitter & unforgettable experience for Ryan.

From 2018 to mid 2020, Ryan and the team worked very hard to build a totally new runtime called Deno using modern technologies like Rust & Tokio. Deno was built from scratch.

From the first GA (1.0.0) till today, there has been 28 major releases (current version is 1.28 at the time of writing).

This also answers the question of why Deno’s name is an anagram of Node.

Is Deno a serious project?

The short answer is: Of course!

The first credibility marker is the person behind the Deno. Coming from a well known person like Ryan Dahl establishes a small baseline credibility.

The second credibility marker is money. While the core Deno team was busy in churning out features, the top people managed to get funding of $4M in Mar 2021 for development of a secret project that uses Deno. They formed what’s called Deno company and Deno moved as an open source project under the company. Ryan Dahl is the CEO of the Deno company. If you think $4M was a lot, the Deno company received another funding of $21M to further develop their secret project/product (called Deno Deploy).

Although the investor money is intended for the product, some part of it will go to the community through the core Deno project.

At this point, money is not an issue behind Deno. It’s very unlikely that you’ll use Deno for one of the important projects, and after a couple of years you find that Deno no longer exists.

Why should I use Deno instead of Node.js?

A very good question indeed. Even the Deno team is trying to find the answer for this. We’ll also give it a try.

The extremely popular Node.js is trusted by hundreds of companies for their production web services. Node.js is battle tested for more than 10 years in the field. Above everything else, Node.js is trusted to be reliable. No one doubts Node.js’s reliability. There is no way Deno can expect them to cut the chord with Node.js and move to Deno. That’s not going to happen.

At best, Deno can target new projects. The non-critical projects to start with. Let’s say you want to build a new web service for your company. The question would be to choose between Node.js and Deno. That’s a tough call to make.

Here are the reasons why would a company will choose Deno over Node.js:

  • Security: The first major advantage with Deno is excellent sandboxing. Deno runs in a very secure sandbox that doesn’t have any kind of access by default. Access can be enabled at granular level for file system, network, environment, child process, etc.
  • Web APIs: The second major advantage with Deno is excellent support for web APIs. This makes the life of full-stack developers easier. They are able to use the exact same web APIs that they use for frontend development. Deno already has support for many web APIs. The list keeps growing with ongoing releases.
  • NPM compatibility: The third major advantage with Deno is the recently added NPM compatibility. Initially, Deno didn’t support NPM. This became a big blocker because a giant package manager, like NPM, almost always has a package ready for whatever you need. With the most recent release, Deno has full support for NPM. All 1.4M packages can be used.
  • Secure NPM: The final major advantage is secure NPM. It’s not only about supporting NPM packages. The same NPM package runs securely under Deno. You know exactly what resources are being used. This, in my view, is a huge plus point for Deno.

Is Deno ready for production?

It took some time for Deno to get reliable, but now it looks a solid, reliable runtime. Deno’s own websites uses Deno in the backend:

Deno’s site also has a showcase about some companies using it to build their webapps:

The number is still not large.

One of Deno’s big wins is Slack. The messaging giant Slack chose Deno for it’s sandboxing:

Coming back to the question: Deno does look like a good, reliable, and secure alternative to Node.js.

Thanks for reading! More articles on similar topics can be seen in the magazine: The JS runtimes.

--

--