Deno v2.1
Sneak peak
Wasm imports
import { exported_add } from "./add.wasm";
console.log(`exported_add: ${exported_add(4, 5)}`);
Works in deno run, deno compile and more.
Prerequisite for bytes and text imports
Stack trace in permission prompt
Show a JavaScript stack trace when a permission is requested
Requires DENO_TRACE_PERMISSIONS env var as it incurs a significant overhead. Works in all subcommands.
deno update and deno outdated
Update jsr and npm dependencies from the command line
Highly requested!
Better CommonJs support
Run existing Node.js projects using CommonJs, with a single line change:
// package.json
{
“type”: “commonjs”
}
// main.js
const hello = require(“./hello”);
hello();
$ deno main.js
Hello world
deno task workspace and dependency support
Equivalent to https://pnpm.io/cli/recursive and https://pnpm.io/filtering (https://github.com/denoland/deno/issues/24991)
Support for “object notation” for tasks, with a “dependency” setting to run other tasks as prerequisites, similar to https://github.com/google/wireit. Requested by PatrickJs
deno compile 🚀
deno coverage ignores
Makes Deno more capable and feature par with tools like nyc or istanbul
--unstable-node-globals flag
Makes globals like Buffer, global and more available by default for even more enhanced backwards compatibility.
--allow-env wildcards
Allow access to scoped env vars:
--allow-env=AWS_*
--allow-env=DENO_*
--allow-env=MYCOMPANY_*
Built-in tracing/OTEL support
Deno.tracing namespace that integrates seamlessly with OTEL libraries using https://jsr.io/@deno/otel
fetch API instrumented by default. Instrument a couple more APIs before 2.1 release.
Easier npm create equivalent
deno init npm:svelte
Implies read, write, env, run permissions. Makes the invocation 50% shorted.