Deno 2: The Node.js Alternative That Now Runs npm Packages
Deno 2 drops in npm and Node.js compatibility while keeping its permission model and built-in TypeScript - here is what changed, what still differs, and when to choose it.
Mahmudul Haque Qudrati
CEO & ML Engineer
One AI engineering post, weekly
LLM benchmarks, prompt techniques, and token-cost breakdowns — not another AI news roundup.
Deno's original pitch was compelling: TypeScript out of the box, URL imports, a secure-by-default permission model. But it ran almost no npm packages - which excluded 95% of the JavaScript ecosystem. Deno 2 fixes that without abandoning what made Deno good.
npm and Node.js Compatibility
Deno 2 can run most npm packages with the npm: specifier:
// deno run --allow-net server.ts
import express from "npm:express";
const app = express();
app.get("/", (req, res) => res.json({ hello: "world" }));
app.listen(3000);
Or with a package.json and deno install:
{
"imports": {
"express": "npm:express@4",
"zod": "npm:zod@3"
}
}
deno install # reads package.json, installs to Deno's global cache
deno run server.ts
Node.js built-in modules (node:fs, node:path, node:http) are fully supported. Most Express/Fastify/Hapi applications run without changes.
Team workspace
Ship faster with chat, meetings, and projects in one place — Zlyqor.
The Permission Model
Unlike Node.js, Deno requires explicit permission grants. No permission = no access:
# Grant specific permissions
deno run --allow-net=api.example.com:443 --allow-read=/tmp --allow-env=DATABASE_URL server.ts
# Grant all (not recommended)
deno run --allow-all server.ts
This is the biggest operational difference from Node.js. In CI or production, you define exactly what the script is allowed to do. No surprise file system access from a malicious dependency.
JSR - The JavaScript Registry
JSR (jsr.io) is Deno's alternative to npm, designed from the start for TypeScript:
// Native Deno packages - no build step, TypeScript source published directly
import { z } from "jsr:@zod/zod";
import { Hono } from "jsr:@hono/hono";
JSR packages are TypeScript-first, have enforced documentation, and are scored on quality metrics. They work in both Deno and Node.js (JSR generates npm-compatible builds automatically).
Built-In TypeScript - No Config
# TypeScript works with zero config
deno run server.ts # no ts-node, no tsx, no tsc compile step
deno check server.ts # type checking only
Deno bundles its own TypeScript compiler. No tsconfig.json is required (though you can use one for IDE support).
deno compile - Single Executables
# Compile to a standalone binary - no Deno runtime needed on the target machine
deno compile --allow-net --allow-read server.ts
# Cross-compile for different platforms
deno compile --target x86_64-pc-windows-msvc server.ts
deno compile --target x86_64-apple-darwin server.ts
The resulting binary includes the Deno runtime, your code, and all dependencies.
Performance Comparison vs Node.js
On an M2 Pro, identical HTTP server:
| Metric | Deno 2 | Node.js 22 |
|---|---|---|
| HTTP req/s (no framework) | 98,000 | 82,000 |
| File read (1MB) | 1.2ms | 1.4ms |
| Startup time | 12ms | 45ms |
| TypeScript startup (no compile) | 15ms | 380ms (tsx) |
Deno's TypeScript startup is the clearest win - no compilation step means fast restarts.
Deno Deploy - Edge Runtime
Deploy to Deno's global edge network:
deno install -A jsr:@deno/deployctl
deployctl deploy --project=my-app server.ts
Deno Deploy runs on 35+ regions, starts in under 1ms (V8 isolates, same model as Cloudflare Workers), and has a generous free tier.
References: Deno 2 · Deno Deploy · JSR

Mahmudul Haque Qudrati
CEO & ML Engineer
Visionary technologist, software engineer, and machine learning specialist. Founder and CEO of Pristren, directing engineering teams that ship production-grade AI/ML pipelines, mission-critical full-stack applications, and developer tooling. Creator of Zlyqor, the unified team workspace platform. Author of 540+ technical guides and benchmark research reports on large language models, agentic workflows, Model Context Protocol (MCP), and modern web stacks.
More from Mahmudul
Related Articles
How to Use Claude to Make Videos Like Vox and Others
Claude can help you make Vox-style videos by generating scripts, editing with code, and automating animation. Here's a practical guide with real workflows and costs.
OpenAI Ends Cursor Model Access on Nov 12, 2026: What Developers Need to Know
OpenAI will terminate Cursor's access to its models on November 12, 2026, following SpaceX's acquisition. This guide explains the timeline, why it happened, and practical steps to migrate your workflow.
What is Codex starts encrypting sub-agent prompts? A Practical Overview
OpenAI Codex now encrypts sub-agent prompts by default. This change affects how agentic systems share context between sub-agents. Here's what it means for your AI pipelines.
// discussion
Comments