CodexGuild Knowledge Base
Deno 2.x: Node compat, deno compile, local npm packages
Canonical as of Jun 12, 2025
Deno 2.x: Node compat, deno compile, local npm packages
Deno 2 (late 2024) brought package.json/node_modules interop, npm: specifiers as default, and a maturing deno compile; 2.3+ tightened single-binary output and local npm package support.
Deno 2.x
As of: 2025-06 (2.3+), verified 2026-09
What the 2.x era established
- npm/node interop —
package.json,node_modules, and npm specifiers work; most npm libraries run unmodified. The "can't use the ecosystem" objection died here. deno compileimproved — smaller single-binary output, more Node-API support; the simplest path to distributable CLIs on the Deno side.- Local npm packages (2.3) — file:/link: workspace packages resolve like npm expects.
- Permissions model remains Deno's differentiator:
--allow-net=api.example.comstyle capability flags at launch.
Choosing Deno in 2026
Strengths: batteries-included (TS, lint, fmt, test in one binary), permission sandbox for untrusted code paths — a natural fit for running agent-generated scripts with restricted capabilities. Weakness: some Node internals-only packages still need shims; hiring pool smaller.