Node.js → Deno 2
mediumDeno 2 is Node-compatible: npm packages work, node: builtins work, package.json supported. Migration is mostly removing boilerplate and fixing path imports.
curl -fsSL https://deno.land/install.sh | sh
Try running your entry point — Deno 2 reads package.json and resolves npm deps automatically.
deno run --allow-all src/index.ts
Deno requires explicit .ts extensions in local imports: import './utils' → import './utils.ts'.
Node built-ins still work via node: prefix. Deno's own std is at jsr:@std/. Use JSR for new dependencies where available.
process.env → Deno.env.get(). process.exit() → Deno.exit(). __dirname → import.meta.dirname.
Add deno.json for tasks, permissions, import aliases. Replaces package.json scripts for Deno-native workflow.
{ "tasks": { "dev": "deno run --watch --allow-all src/index.ts" } }deno lint && deno test
What this migration involves
Moving from Node.js to Deno 2 is rated medium and takes about 4-12h on a typical project. The guide breaks it into 7 steps, 4 of which ship with runnable commands and 1 with a verification check.
Related migrations
FAQ
How long does migrating from Node.js to Deno 2 take?
Around 4-12h for a typical project — 7 steps, difficulty rated medium, 4 of them with copy-paste commands.
Is moving from Node.js to Deno 2 reversible?
No reverse guide is tracked yet, so treat this as a one-way move and keep a full export of your Node.js data before you start.
What does Deno 2 cost compared to Node.js?
Pricing for both tools is contact-based or not tracked yet.