Written on 21 Jan 2023
Deno by default in 2023?
There. I said it. And I mean it.
But Node has issues and deviates from the browser in some really annoying ways: namely importing, fetching data, and security. I know many of these things are being worked on, but Deno seems to be going in a direction that I like better on all three of these fronts.
- Deno uses the ECMAScript standardized
importto get dependencies, but they’re not in your local project directory! They’re in a global folder and you install them using straight up URLs. That’s pretty fucking cool, because I currently have 23 gigabytes worth of
node_modulesfolders on my laptop right now!
- I know that Node 18 just shipped with
fetchbut I want a server JS runtime that tries to be as similar to a browser as possible. The web is cool and advanced and I want to use more of it, not learn custom APIs. Deno agrees and says this straight up on their homepage: "A runtime that resembles the web, using browser APIs that work on the server." A-fucking-men.
- It’s nothing short of a miracle that Node has worked as well as it has. We say "computer, install 23 gigabytes of other people’s code and let it just run on my computer please." That it hasn’t catastrophically failed doesn’t mean it’s a good system. It just means we’ve been lucky. I like the security-oriented mindset that the Deno folks have, you have to give access to the resources you want the script to use, be it the file system, network access, or anything else on your device. That’s cool!