Deno 2.0 Released After 4 years With Major Updates

Deno is the open-source JavaScript runtime for the modern web. It natively supports TypeScript, JSX, and modern ECMAScript features with zero configuration. Deno was invented by the creator of Node.js, Ryan Dahl. He felt NodeJS is not the best system to build a massive server web. It is released under MIT license.
Deno 1.0 was great and it released 4 years back. Now Deno is coming up with version 2.0 with Major updates.
Global variable window
, which was introduced in 1.0 is removed. Deno users need to take care while migrating to 2.0.
Global variable process
has been added to be compatible with Node.
Deno 2.0 is now compatible with Node.js and npm, allowing users to run existing Node applications seamlessly. It understands package.json
and node_modules
. Deno also supports Private npm registries.
Without package.json
and the node_modules
folder, Deno will install your package in the global cache. This allows users to write programs with npm dependencies in a single file.
import got from "npm:got@14.4.3";
For larger projects, dependencies can be placed in a separate deno.json
file
// deno.json
{
"imports": {
"got": "npm:got@14.4.3"
}
}
import the library as below
import got from "got";
Deno 2 can be used with major JavaScript frameworks like Next.js, Astro, Remix, Angular, SvelteKit.
deno install
installs your dependencies at lightning speed. If you have a package.json it will create a node_modules folder in the blink of an eye. If you don’t use package.json, it will cache all of your dependencies to the global cache.
deno add
and deno remove
can be used to add and remove packages to/from your package.json or deno.json. It is similar to npm install and npm remove
Deno previously introduced Javascript Registry called JSR. The purpose of the registry is to support TypeScript natively.
Deno planning to introduce Long Term Release channel where LTS channel will receive critical bug fixes back-ported for six months, ensuring a stable and reliable base for production use. After six months, a new LTS branch will be created based on the latest stable version.