Deno? Deno!

So except NodeJS we now have Deno - a new backend runtime environment for JavaScript. The new child of Ryan Dahl promises to be even cooler than the first one. Node’s reach over the years turned out to be astonishing. So when the creator of such a powerful tool says “Behold mankind! I have a new #better #safer gift for you!” then every dev related to JS naturally gets an itch that can only be tamed by confronting the dinosaur. In this article, I’ll tell you about my meeting with the beast.

You can come out, node_modules is not here!

Influence

A little digression into history. After creating Node Ryan Dahl switched to Golang for a couple of years. Eventually, he came back to JS world with a new great plan - to create a better tool than Node. Because of that sequence, Deno is heavily influenced by Golang. Developers who have some experience with Golang will notice a lot of similarities between the two. This borrowing is a very natural and common phenomenon - languages and frameworks are evolving by “stealing” ideas. Pretty often language/framework of the original idea will later borrow improved previously borrowed from its idea. A small fact worth mentioning in this criminal context.

My way to Deno

The original reason for me to try Deno was interest in TypeScript. TS’s documentation and binaries availability are really good - after just a few minutes you can easily run it with Node. Write some TS code, compile, run compiled result with Node - voila, discovering on fire. But any sane developer in this world will naturally want to optimize and improve this workflow. Thus for starters install watcher, linter & test runner. It’s where complications with TS+Node started to appear. Of course, all of that stuff is out there for Node along with tons of articles about it. But none of that seemed simple or complete enough. After some time except music, my working space started to fill up with a fine amount of selective cursing. At some point, I remembered about Deno. The frustration level was already enough to switch immediately.

Differences from NodeJS

So what are the key differences between Deno and Node? The first one is that it ships as a single binary. That’s right - the whole Deno is just one file. It can’t get simpler than that.

Let’s talk about package management - there is no any. Dunno what was your reaction when you’ve heard it for the first time. Mine was sincere “what the fuck?”. In the heyday of package managers, it’s weird to not have one. But this is exactly the way how browsers load sources. Anyway - getting used to it is a matter of minutes.

Permissions - a totally new thing. Accessing anything outside RAM is impossible without explicitly allowing it - a nice feature to have by default.

Equipment included

There are two opposite approaches to create language or framework. One is writing the bare minimum and allow the community to fill the gaps. Or creating most of the ecosystem from the beginning. Deno author(s) choose the latter. Linter, formatter, builder, test runner, and a lot of other stuff come with it. Not mentioning a rich standard library. But it’s a debatable topic - two “Neo” friends of mine have already told me that it’s too heavy and “I want to have freedom of choice regarding stuff I use in my project”. Totally valid point. But having all of that stuff out of the box doesn’t mean you can’t use third parties. The real question would be: how often do you need fancy vendor tools? Of course, some projects will require subtle configuration but not so many. Usually, you just need to start working. Deno provides smart defaults to help you do exactly that avoiding inventing a weel with 4-hour mumbo-jumbo of project initialization. Also having best-practice defaults included increases awareness of newcomers. In many languages (without having a mentor) it’s a matter of luck to bump into “holy commandments of do-s and don’t-s” (conventions), but in Deno’s case changes are higher.

Summary

One just can’t not (ah shit, double negative…) to value how well everything is thought out in Deno. Some stuff is different from what we used to, however, this is the usual way of progress. After reading the article before publishing it seemed very biased. But it’s really because of such a pleasant experience with this tool - no one pays me for so many prases :). Thanks for reading this far - hope you’ve found this content useful. Cheers.