DEV Community

Alex Spinov
Alex Spinov

Posted on

Deno 2 Has a Free Node-Compatible Runtime — NPM Packages Just Work

Deno 2 runs Node.js packages without changes. TypeScript by default, built-in formatter/linter/test runner, and a security-first permissions system.

What Changed in Deno 2

Deno 1 was idealistic: no npm, no node_modules, URL imports only. Great in theory, ecosystem adoption was slow.

Deno 2: full npm compatibility. Your package.json, your node_modules, your npm packages — they just work.

What You Get for Free

TypeScript without config:

// Just run it. No tsconfig, no compilation step.
const response = await fetch('https://api.example.com/data');
const data: { name: string }[] = await response.json();
console.log(data);
Enter fullscreen mode Exit fullscreen mode
deno run main.ts  # TypeScript runs directly
Enter fullscreen mode Exit fullscreen mode

Built-in tools (no extra packages):

deno fmt          # format code (like Prettier)
deno lint         # lint code (like ESLint)
deno test         # run tests (like Vitest)
deno bench        # benchmark code
deno doc          # generate documentation
deno compile      # compile to standalone binary
Enter fullscreen mode Exit fullscreen mode

No npm i -D prettier eslint vitest. It's all built in.

Security permissions:

deno run --allow-net --allow-read main.ts
Enter fullscreen mode Exit fullscreen mode

Without --allow-net, your code can't make network requests. Without --allow-read, it can't read files. A compromised npm package can't steal your SSH keys.

npm compatibility:

import express from 'npm:express';
import chalk from 'npm:chalk';
// Or use package.json like Node.js
Enter fullscreen mode Exit fullscreen mode

Quick Start

curl -fsSL https://deno.land/install.sh | sh
deno run https://examples.deno.land/hello-world.ts
Enter fullscreen mode Exit fullscreen mode

Deno Deploy

Deno's cloud platform deploys globally at the edge:

  • Free tier: 100K requests/day
  • Deploy from GitHub — push to deploy
  • KV database — built-in key-value store
  • Cron — scheduled tasks
  • Queues — background job processing

Why Consider Deno 2

  1. Zero toolchain — no webpack, no babel, no tsconfig, no eslintrc
  2. Security — explicit permissions prevent supply chain attacks
  3. Single binarydeno compile creates a standalone executable
  4. Web standardsfetch, Request, Response, Web Crypto, Streams — all built-in
  5. npm works — no ecosystem sacrifice

If you're tired of configuring Node.js toolchains — Deno 2 includes everything you need in one binary.


Need web scraping or data extraction? Check out my tools on Apify — get structured data from any website in minutes.

Custom solution? Email spinov001@gmail.com — quote in 2 hours.

Top comments (0)