Deno 2.0 Released - Major Enhancement of Node.js Compatibility

2025.12.18

Deno 2.0 Finally Released

In October 2024, Deno 2.0 was officially released. With significantly enhanced Node.js compatibility, practicality has dramatically improved. Deno, which Ryan Dahl said he “built to learn from Node.js’s shortcomings,” has finally become a viable option.

What is Deno: A JavaScript/TypeScript runtime developed by Ryan Dahl, the creator of Node.js. Features include security, native TypeScript support, and modern web standard APIs.

Major New Features

1. Full npm Compatibility

You can now use npm packages as-is. You can import directly using the npm: schema.

// Import npm packages directly
import express from "npm:express@4";
import { z } from "npm:zod";

const app = express();
app.get("/", (req, res) => {
    res.json({ message: "Hello from Deno!" });
});

app.listen(3000);

Most npm packages work, making migration from Node.js easy.

2. package.json Support

With package.json, you can use traditional npm install and node_modules.

# Run existing Node.js project with Deno
deno run --allow-net --allow-read app.js

# package.json scripts can also be run
deno task start

3. LTS (Long Term Support) Introduction

With enterprise adoption in mind, LTS versions have been introduced. With long-term support for stable versions, production use has become realistic.

4. Workspaces and Multiple Project Management

Supports monorepo configurations. You can define workspaces in deno.json.

// deno.json
{
  "workspace": ["./packages/api", "./packages/web", "./packages/shared"]
}

5. Package Publishing via JSR

JSR (JavaScript Registry) has arrived. You can publish TypeScript as-is and distribute packages usable by both npm and Deno.

// Import from JSR
import { assertEquals } from "jsr:@std/assert";

// Publishing is easy
// deno publish

Security Model

Deno’s signature security model has also evolved.

# Explicitly allow only necessary permissions
deno run --allow-net=api.example.com --allow-read=./data app.ts

# Allow all permissions (recommended only during development)
deno run -A app.ts
Permission FlagDescription
--allow-netNetwork access
--allow-readFile reading
--allow-writeFile writing
--allow-envEnvironment variable access
--allow-runSubprocess execution

Development Tool Enhancement

Deno 2.0 also significantly improves the development experience.

Built-in Tools

# Formatter
deno fmt

# Linter
deno lint

# Test runner
deno test

# Benchmark
deno bench

# Documentation generation
deno doc

# Bundler
deno compile  # Generate single executable

TypeScript Native

TypeScript works out of the box without configuration. No need to struggle with tsconfig.json settings.

// app.ts - Can be executed as-is
interface User {
    id: number;
    name: string;
}

const user: User = { id: 1, name: "Tanaka" };
console.log(user);

Comparison with Node.js

FeatureDeno 2.0Node.js
TypeScriptNative supportRequires transpiler
SecurityExplicit permission controlAll permissions by default
Package managementURL/npm/jsrnpm
Config filesMinimalMany required
Web standard APIsFetch etc. standard supportAdded from v18
EcosystemRapidly growingHuge & mature

Framework Support Status

Here’s the Deno support status for major frameworks.

  • Fresh: Deno’s official full-stack framework (Islands Architecture)
  • Hono: High-speed web framework (full Deno support)
  • Oak: Express-like middleware framework
  • Express: Works via npm compatibility
  • Next.js: Partial support
// Hono example
import { Hono } from "npm:hono";

const app = new Hono();

app.get("/", (c) => c.json({ message: "Hello Hono!" }));

Deno.serve(app.fetch);

Summary

Deno 2.0 has become a practical option with significantly enhanced Node.js compatibility. It has many advantages including security, native TypeScript, and modern APIs. For new projects or security-focused projects, it’s worth actively considering.

← Back to list