Deno 2 brings workspaces, first-class npm compatibility, and the JSR registry to the modern JavaScript runtime. Test your understanding of these features and Deno's security-first design.
0 / 5 completed
1 / 5
What is the purpose of JSR (JavaScript Registry) in the Deno 2 ecosystem?
JSR (JavaScript Registry) is a modern package registry designed specifically for TypeScript-first packages that work across Deno, Node.js, and browsers. Unlike npm, JSR stores TypeScript source directly and generates type declarations automatically, giving consumers the best type experience without a build step.
2 / 5
In Deno 2, when you run deno run --allow-read app.ts, what does the --allow-read flag control?
Deno's permission system requires explicit flags to grant capabilities. --allow-read permits file system read access — without it, any attempt to read files throws a permission error. This granular model means compromised or malicious code cannot silently exfiltrate files.
3 / 5
What does the workspaces feature in deno.json allow you to do?
Deno workspaces, configured via the workspaces field in deno.json, let you manage a monorepo where each member package can have its own deno.json while inheriting root-level settings. This mirrors npm/pnpm workspace semantics but uses Deno's native config format.
4 / 5
Which statement best describes Deno 2's npm compatibility approach?
Deno 2's npm compatibility uses the npm: specifier (e.g., import express from 'npm:express') to pull packages directly from the npm registry without needing npm install or a node_modules directory. Deno manages a local cache transparently, making npm packages work alongside Deno-native imports.
5 / 5
In Deno 2, what is the role of deno.json's imports field?
The imports field in deno.json acts as an import map, letting you write import { something } from '$lib/utils.ts' instead of long relative paths or full URLs. This centralises dependency URLs in one place, making version updates a single-line change.