DEV Community

Alex Spinov
Alex Spinov

Posted on

Deno 2 Has a Free Runtime That Runs Node.js Code — With Built-In TypeScript, Linting, and Testing

The Node.js Problem

Starting a new Node project means:

  • tsconfig.json for TypeScript
  • .eslintrc for linting
  • jest.config.js for testing
  • package.json for dependencies
  • node_modules with 1,000 folders

Deno 2 includes all of this out of the box. And now it runs your existing Node.js code.

What Deno 2 Gives You

Native TypeScript

// Just write TypeScript. No tsconfig. No compilation step.
const response = await fetch('https://api.github.com/users/denoland');
const user: { login: string; name: string } = await response.json();
console.log(user.name);
Enter fullscreen mode Exit fullscreen mode
deno run main.ts  # Just works
Enter fullscreen mode Exit fullscreen mode

Node.js Compatibility

import express from 'npm:express';

const app = express();
app.get('/', (req, res) => res.send('Hello from Deno!'));
app.listen(3000);
Enter fullscreen mode Exit fullscreen mode

Deno 2 reads package.json. Uses node_modules if you want. Most npm packages work unchanged.

Built-In Tools

# Linting — no ESLint config needed
deno lint

# Formatting — no Prettier needed  
deno fmt

# Testing — no Jest/Vitest needed
deno test

# Type checking
deno check main.ts

# Benchmarking
deno bench
Enter fullscreen mode Exit fullscreen mode

Permission System

# Explicit permissions — your script can't secretly access the network
deno run --allow-net --allow-read main.ts

# Or allow everything (like Node)
deno run -A main.ts
Enter fullscreen mode Exit fullscreen mode

deno.json — One Config File

{
  "tasks": {
    "dev": "deno run -A --watch main.ts",
    "test": "deno test -A",
    "build": "deno compile main.ts"
  },
  "imports": {
    "@std/": "jsr:@std/"
  }
}
Enter fullscreen mode Exit fullscreen mode

Replaces package.json, tsconfig.json, .eslintrc, jest.config, and prettier.config.

Compile to Single Binary

deno compile --output myapp main.ts
# Produces a single executable — no runtime needed
./myapp
Enter fullscreen mode Exit fullscreen mode

Why This Matters

Deno 2 isn't fighting Node anymore — it's absorbing it. Run your existing Node code, but with TypeScript by default, security by default, and zero configuration. The future of JavaScript is simpler than its past.


Building Deno APIs that need web data? Check out my web scraping actors on Apify Store — structured data via API. For custom solutions, email spinov001@gmail.com.

Top comments (0)