Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Deno Knowledge Patch?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/nevaberry-deno-knowledge-patch-nevaberry-plugins)
---
name: deno-knowledge-patch
description: Deno
version: "2.9.8"
license: MIT
metadata:
author: Nevaberry
---
# Deno Compatibility Guidance
Load this skill when migrating Deno code, managing dependencies and workspaces,
configuring permissions, building executables, or working with Deno's tools and
runtime APIs. Use the topic references for complete guidance and examples;
their batch attributions distinguish version-dependent behavior.
## Reference index
| Reference | Topics |
| --- | --- |
| [Migration](references/migration.md) | Configuration, command placement, caches, changed declarations |
| [Dependencies and workspaces](references/dependencies-and-workspaces.md) | npm and JSR, manifests, registries, lockfiles, catalogs, local links |
| [Permissions and security](references/permissions-and-security.md) | Scoped permissions, import and network checks, audits, dependency age, scripts |
| [Build, publish, and deploy](references/build-publish-and-deploy.md) | Compile assets, bundles, declarations, npm tarballs, JSR publishing, deployment |
| [Testing, lint, and format](references/testing-lint-and-format.md) | Native and Node tests, snapshots, coverage, lint plugins, formatting |
| [Tooling and editor](references/tooling-and-editor.md) | Type checking, tasks, preloads, watching, debugger, upgrades, editor, Jupyter |
| [Networking and observability](references/networking-and-observability.md) | Servers, fetch, TLS, proxies, WebSockets, QUIC, OpenTelemetry |
| [Runtime and Web APIs](references/runtime-and-web-apis.md) | Imports, workers, cloning, streams, Web Crypto, graphics, files, subprocesses |
| [Node compatibility](references/node-compatibility.md) | Modules, filesystem, SQLite, HTTP/TLS, processes, workers, crypto, native addons |
| [Desktop and ecosystem](references/desktop-and-ecosystem.md) | Desktop windows and packaging, Fresh, Sandbox, Deploy, Subhosting, KV |
## Breaking changes and deprecations
- The `importMap` field in `deno.json` accepts local files only. Save a remote
map alongside the config and set `"importMap": "./import_map.json"`.
- Deno rejects unsupported `compilerOptions`. Type checking enables
`noImplicitOverride` by default; overriding methods need `override`.
The override check is skipped for remote modules.
- Put subcommand flags after the subcommand: `deno run --allow-read main.ts`.
Putting `--allow-read` before `run` produces an error.
- Rename `patch` to `links` in `deno.json` to avoid a deprecation warning for
local package overrides, for example `"links": ["../cowsay"]`.
- Global `setTimeout()` and `setInterval()` return Node timer objects by
default. Use `ReturnType<typeof setTimeout>` for a stored timeout handle.
- Deno removed `fs.promises.fstat`. Call `fileHandle.stat()` for a file opened
with `node:fs/promises`.
- The `Hash` and `Hmac` constructors are deprecated. Use `createHash()` and
`createHmac()` from `node:crypto`.
- `Duplex.toWeb()` from `node:stream` emits `DEP0201` when called with the
`type` option.
- `deno fmt` formats HTML by default and drops indented `.sass` support.
Markup, CSS, and SQL formatters change only whitespace and pass malformed
input through.
- `deno publish` continues processing a workspace after one package fails.
A failed publish command can leave some packages published.
## Changed defaults in tests and HTTP servers
`Deno.test()` defaults both `sanitizeOps` and `sanitizeResources` to `false`.
Enable them per test with `{ sanitizeOps: true, sanitizeResources: true }`,
per module with `Deno.test.sanitizer({ ops: true, resources: true })`, or
project-wide under `test` in `deno.json`.
Automatic response compression in `Deno.serve()` is off by default. Set
`DENO_SERVE_AUTOMATIC_COMPRESSION=1` process-wide or enable it per server:
```ts
Deno.serve({ automaticCompression: true }, () => new Response("Hello"));
```
Relying on `Deno.serve()` aborting `request.signal` after a successful response
triggers a one-time deprecation warning. Run with `--unstable-no-legacy-abort`
or set `{"unstable": ["no-legacy-abort"]}` in `deno.json` to opt into the new
behavior where a successful response leaves the signal unaborted.
Streamed HTTP response bodies must emit `Uint8Array` chunks. Pipe a string
stream through `new TextEncoderStream()` before passing it to `Response`.
Deno truncates a streaming response at its declared `Content-Length`.
If the stream's byte count is unknown, let the server choose its framing.
## Permission configuration and checks
- Select a named permission set with `deno run -P=data main.ts` or
`deno run --permission-set=data main.ts`; bare `-P` selects `default`.
Permissions under `test`, `bench`, or `compile` also use `-P`.
With `test.permissions` configured, `deno test` needs `-P` or explicit flags.
- A more specific `--allow-*` entry overrides a matching `--deny-*` entry:
`deno run --deny-read=./data --allow-read=./data/public.json main.ts`.
- `--no-prompt` also disables prompts from `Deno.permissions.request()`.
- Double literal commas in permission paths: granting
`--allow-read=data/a,,b.csv` permits reads of `data/a,b.csv`.
- Unix-domain socket operations require `--allow-net`, including Unix socket
proxies. Rules can use `--allow-net=unix:/var/run/app.sock`.
- `fetch()` and `WebSocket` check resolved IPs against `--deny-net`;
remote imports check resolved IPs against `--deny-import`.
- Opening a file with creation enabled requires write permission.
CommonJS resolution checks read permissions for paths it needs to inspect.
Compiled executables check read permissions for dynamic local imports from
disk; grant needed paths with `deno compile --allow-read`.
- The experimental permission broker uses `DENO_PERMISSION_BROKER_PATH`.
While active, it ignores all `--allow-*`, `--deny-*`, and `--ignore-*` flags.
## Dependencies, workspaces, and supply-chain controls
Bare names in `deno add`, `deno install`, and global installs resolve through
npm. Use `jsr:` for explicit JSR dependencies. A root `workspace` array can
mix directories containing `package.json` and `deno.json` and can use globs.
- `deno ci` requires `deno.lock`, removes existing `node_modules`, and installs
in frozen mode. It accepts `--prod` and `--skip-types`.
- `deno install --prod` skips both `devDependencies` and `@types/*` packages.
- `deno update --lockfile-only` updates resolved versions in `deno.lock`
while leaving manifest declarations intact.
- `deno list` shows requirements and resolved versions; `deno why qs` shows
installed versions and the dependency paths leading to them.
- Root `catalog` and `catalogs` entries define shared dependency ranges.
Members use `catalog:` or `catalog:<name>` in `package.json` declarations.
- Set `{"preferPackageJson": true}` in `deno.json` to direct `deno add`,
`deno install`, and `deno remove` changes to `package.json`.
- New npm resolutions default to a 24-hour minimum release age unless
configured. Set `min-release-age=0` in `.npmrc` to opt out.
- `--min-dep-age` aliases `--minimum-dependency-age`.
`deno install --min-dep-age=120` requires newly resolved versions to be at
least 120 minutes old; out-of-range configuration values are rejected.
- `deno audit` checks npm and JSR dependencies for known vulnerabilities.
`deno audit fix` upgrades affected npm dependencies to the nearest patched
versions within their constraints and separately reports upgrades outside them.
- `deno approve-scripts` selects packages allowed to run lifecycle scripts
and saves `allowScripts` in `deno.json`.
- `deno x` defaults to `--allow-all` when no permission flags are passed.
Accepting its download prompt also allows lifecycle scripts to run.
`deno x --ignore-scripts npm:prettier --version` skips install scripts.
## Tests, snapshots, coverage, and lint
- `t.assertSnapshot()` inside `Deno.test()` compares against
`__snapshots__/<test file>.snap` without requesting filesystem permissions
for that path. `deno test -u` regenerates snapshots; full updates prune stale entries.
- `deno test --changed`, `deno test --changed=origin/main`, and
`deno test --related=src/util.ts` select tests through dependency relationships.
Lockfile, config, import map, or `package.json` changes trigger a full run.
- `deno test --retry=2` permits two extra attempts on failure;
`deno test --repeats=5` requires five extra runs to pass.
- `deno test --shard=2/3` selects the second of three balanced groups.
Shards are 1-based, assigned before shuffling; an empty shard succeeds.
- `Deno.test.each(cases)(name, fn)` registers a filterable test for each case.
- `deno test --coverage --coverage-threshold=90` fails on a coverage shortfall.
`deno test --coverage --coverage-raw-data-only` collects only raw data.
- `no-unversioned-import` is in the recommended lint set. The automatic
`workspace` set's `no-import-prefix` flags inline `npm:`, `jsr:`, and `https:`
specifiers; declare dependencies in a manifest and import by bare name.
- `no-process-global` and `no-node-globals` are opt-in lint rules.
The lint plugin API remains unstable; plugins have `env` and `read` permissions.
## Build, publish, and deploy
- `deno compile --include ./names.csv --include ./data/ main.ts` embeds assets.
Read them with filesystem APIs and paths relative to `import.meta.dirname`.
- `deno compile --include-as-is dist/ --allow-read server.ts` embeds assets
verbatim alongside modules processed by `--include`.
- `deno compile .` detects supported frameworks, runs `deno task build`, and
generates a standalone entry point.
- The unstable `deno compile --bundle --minify main.ts` bundles and minifies
before embedding; workers receive separate bundles.
- `deno bundle --outdir dist index.html` bundles referenced scripts,
rewrites their paths, and links bundled CSS imported by scripts.
- `deno bundle mod.ts --outdir dist --declaration` emits JavaScript and one
declaration file per entry point with re-exports inlined.
- `Deno.bundle()` is experimental and requires `--unstable-bundle`.
It honors the calling runtime's file permissions.
- `deno pack --output my-package.tgz` creates an npm-publishable tarball.
It preserves `Deno.*` calls and no longer injects `@deno/shim-deno`;
include that shim explicitly if the npm package relies on it under Node.
- `deno publish` at the workspace root determines package order from
dependencies. Set `"publish": false` to exclude a package from JSR publishing.
- `deploy.include` and `deploy.exclude` control uploaded files.
`deno deploy` selects the latest deploy CLI release from JSR.
## Tasks, imports, and runtime features
Task `dependencies` name prerequisites in the same package; independent tasks
run in parallel, shared prerequisites run once, and cycles are rejected.
`deno task --recursive --jobs 1 build` runs workspace tasks sequentially.
`deno task --if-present build` succeeds when the task is missing.
For command tasks, `files` and optional `output` globs enable caching when
at least one input file matches; see the task reference for cache-key inputs.
Text imports using `with { type: "text" }` work without an unstable flag.
Byte imports using `with { type: "bytes" }` and CSS stylesheet imports using
`with { type: "css" }` require `--unstable-raw-imports`.
`Temporal` and `BroadcastChannel` are stable.
Set `OTEL_DENO=1` to enable stable OpenTelemetry instrumentation without
`--unstable-otel`. Instrumentation covers `console.log()`, `Deno.serve()`,
and `fetch()`; custom metrics and spans use `npm:@opentelemetry/api`.
The networking reference covers exporters, sampling, and span limits.
## Desktop and ecosystem entry points
`deno desktop main.ts` opens an experimental native desktop app.
The system webview is the default backend; `--backend cef` bundles Chromium.
`Deno.BrowserWindow`, `Deno.Tray`, macOS `Deno.Dock`, and `Deno.autoUpdate()`
provide window, tray, dock, and update APIs. The desktop reference contains
framework integration, packaging, binding, Fresh, Sandbox, and hosting guidance.