Going from Node.js to Deno: Part 1 — Introduction
Node.js is a 13 year old, very popular server side runtime that runs JavaScript code in the backend. Deno is a 4 year old, relatively new runtime that runs JavaScript and TypeScript code in the backend. There are similarities and differences between Deno and Node.js.
Considering the extreme popularity of Node.js and the fact that Deno is slowly gaining grounds, in the near future, a large number of developers may need to transition from Node.js to Deno, or work on both the technologies together. Either way, there will be a need to learn or transition to Deno.
In this series of articles (part 2, part 3, part 4, part 5, part 6, part 7, part 8, part 9), we’ll provide a comprehensive guide for Node.js developers who are interested in learning and working on Deno.
Definition
The first thing is to look at the definition of Node.js and Deno. What exactly are they? In their own words, here are definitions:
Node.js
Deno
Both Node.js and Deno are single threaded, event driven, asynchronous runtimes that are designed to build scalable & performant network applications.
Programming languages
Node.js can run JavaScript applications out of the box and TypeScript applications through additional NPM packages.
On the other hand, Deno can run both JavaScript and TypeScript applications out of the box.
Creator
Both Node.js and Deno are conceived and built by Ryan Dahl. He conceived and built Node.js runtime between 2009–2012 and then handed it over to NPM Inc. After working in other places between 2012–2018, he started working on Deno since 2018.
Owners
Node.js is owned by OpenJS foundation. The Node.js runtime is maintained by the collaborators, who are added by the Technical Steering Committee (TSC) on an ongoing basis. Individuals making significant and valuable contributions are made collaborators and given commit-access to the project. These individuals are identified by the TSC and their nomination is discussed with the existing Collaborators.
Deno is owned by the Deno company, a privately owned company headed by Ryan Dahl, who holds the title of CEO. After an initial funding of 4.1M in March 2021, recently, the Deno company has announced a funding of 21M to develop an Isolate Cloud product (aka Deno Deploy) that’s built over the Deno runtime.
Releases
At the time of writing, Node.js has two release trains: v16.x which is on LTS (long term support), and v18.x which is in development.
Deno is on a single release train and has seen 23 major releases in the last 2 years. At the time of writing, the latest Deno release is v1.23.
GitHub repos
The Node.js core runtime is present in the following GitHub repo:
The Deno core runtime is present in the following GitHub repo:
Underlying technologies
Node.js is written in C++ with support from:
- Google’s V8 engine to run the JavaScript code
- libuv
Deno is written in Rust with support from:
- Google’s V8 engine to run the JavaScript code
- Tokio
Both Node.js and Deno uses the same V8 engine to run the JavaScript code. Any TypeScript code needs to be converted to JavaScript code before it can be executed by the V8 engine.
Standards
Most of the Node.js APIs are proprietary, however in the last few releases Node.js has started supporting the same functionality through web standard APIs.
Deno has supported web standard APIs wherever possible. The list of standard APIs keeps growing with every release.
That’s all about the basic similarities and differences between Node.js and Deno. Other parts in the series are: