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)
---
name: deno-knowledge-patch
description: Deno
version: "2.9.8"
license: MIT
metadata:
author: Nevaberry
---
# Deno Knowledge Patch
Use this skill when migrating Deno projects or working with permissions,
dependencies, workspaces, builds, tests, Node compatibility, runtime APIs,
editor tooling, or desktop applications. Load the reference for the task at hand;
its inline batch attributions preserve the scope of version-specific behavior.
## Reference index
| Reference | Topics |
| --- | --- |
| [Migration](references/migration.md) | Configuration changes, CLI placement, removed APIs, cache paths, changed errors |
| [Permissions and security](references/permissions-and-security.md) | Permission sets, brokers, auditing, network and import rules, dependency trust |
| [Dependencies and workspaces](references/dependencies-and-workspaces.md) | npm and JSR, manifests, catalogs, links, lockfiles, updates, lifecycle scripts |
| [Build, publish, and deploy](references/build-publish-and-deploy.md) | Compilation, embedded assets, bundling, declarations, npm tarballs, JSR, Deploy, Subhosting |
| [Testing, lint, and format](references/testing-lint-and-format.md) | Tests, snapshots, retries, sharding, coverage, lint plugins, formatter settings |
| [Tooling and editor](references/tooling-and-editor.md) | Type checking, tasks, preloads, watch mode, CLI, debugger, language server, Jupyter |
| [Networking and observability](references/networking-and-observability.md) | HTTP servers, fetch, proxies, TLS, WebSockets, QUIC, OpenTelemetry |
| [Runtime and web APIs](references/runtime-and-web-apis.md) | Wasm, raw imports, Web Crypto, streams, cloning, graphics, files, subprocesses, storage |
| [Node compatibility](references/node-compatibility.md) | Module hooks, CommonJS, filesystem, SQLite, networking, workers, crypto, utilities |
| [Desktop and ecosystem](references/desktop-and-ecosystem.md) | Experimental desktop apps, frameworks, backends, bindings, packaging, Fresh, Sandbox |
## Breaking changes and deprecations
- `importMap` in `deno.json` accepts local files only. Save a remote map alongside
the config and set `"importMap": "./import_map.json"`.
- Deno rejects unsupported `compilerOptions`. `noImplicitOverride` is enabled
by default; overriding methods need `override`. Remote modules skip this check.
- Put subcommand flags after the subcommand, as in `deno run --allow-read main.ts`.
`deno uninstall` without `-g` removes a project dependency; use `-g` for global tools.
- Rename `patch` to `links` in `deno.json` to avoid its deprecation warning.
- `Buffer`, `global`, `setImmediate`, and `clearImmediate` are available by default.
Remove `--unstable-node-globals` from commands that used it to expose them.
- Global `setTimeout()` and `setInterval()` return Node timer objects by default.
Use `ReturnType<typeof setTimeout>` to type a stored timeout handle.
- `Deno.test()` defaults `sanitizeOps` and `sanitizeResources` to `false`.
Enable them per test, 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` or use `automaticCompression: true`.
- Relying on `Deno.serve()` aborting `request.signal` after a successful response
triggers a one-time deprecation warning. `--unstable-no-legacy-abort`, or
`"unstable": ["no-legacy-abort"]`, leaves that signal unaborted on success.
- `deno fmt` formats HTML by default and drops indented `.sass` support.
Markup, CSS, and SQL formatters change only whitespace and pass malformed input through.
- `fs.promises.fstat` was removed; 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()` with the `type` option emits deprecation warning `DEP0201`.
`deno pack` no longer injects `@deno/shim-deno`; include the shim explicitly if
the npm package relies on it to use `Deno.*` APIs under Node.
## Permissions and package execution
Select a named permission set with `deno run -P=data main.ts` or
`deno run --permission-set=data main.ts`; bare `-P` selects `default`.
Permission settings 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.
Double literal commas in permission paths: `--allow-read=data/a,,b.csv` grants
read access to `data/a,b.csv`. `--no-prompt` also disables prompts from
`Deno.permissions.request()`.
`--allow-net` accepts subdomain wildcards and CIDR ranges. Unix-domain socket
operations require network permission; socket paths can be scoped with
`--allow-net=unix:/var/run/app.sock`. Fetch proxy transports also need network permission.
Remote imports check resolved IP addresses against `--deny-import`.
`deno x cowsay "Hello"` runs a package binary. Bare names default to npm;
JSR packages need `jsr:`, and local files are rejected. Without permission flags,
the command defaults to `--allow-all`. Accepting its package download prompt
also lets lifecycle scripts run. `deno x --ignore-scripts npm:prettier --version`
skips install lifecycle scripts.
Set `DENO_AUDIT_PERMISSIONS=./permission.log` for JSONL permission checks and
`DENO_TRACE_PERMISSIONS=1` for stack traces. The experimental permission broker
uses `DENO_PERMISSION_BROKER_PATH`; while active, it ignores all `--allow-*`,
`--deny-*`, and `--ignore-*` flags.
## Dependencies and workspaces
`deno add express` and `deno install express` resolve bare names through npm.
Use `jsr:` for JSR. `--package-json` selects `package.json` when both manifests
exist; `"preferPackageJson": true` makes dependency changes prefer that manifest.
`--save-exact` (alias `--exact`) saves a resolved version without a caret.
The root `workspace` array can mix directories containing `package.json` and
`deno.json`, and can use `"workspace": ["./packages/*"]`. Shared ranges live in
`catalog` or `catalogs`; members reference `catalog:` or `catalog:<name>`.
`deno link ../my-lib` adds a local package link; `deno unlink` removes it.
`deno ci` requires `deno.lock`, removes existing `node_modules`, and installs
in frozen mode. It accepts `--prod` and `--skip-types`.
`deno install --lockfile-only` updates the lockfile without installing packages.
`deno update --lockfile-only` leaves manifest declarations intact.
`deno outdated` reports npm and JSR dependencies; `--update` writes updates
within declared ranges, `--latest` allows versions outside those ranges,
and `--recursive` includes workspace members. `deno update "@std/*"` selects
packages by a quoted pattern. `deno why qs` shows dependency paths.
New npm resolutions default to a 24-hour minimum release age unless explicitly
configured. `min-release-age=0` in `.npmrc` opts out. For a two-hour limit, use
`deno install --minimum-dependency-age=120`; `--min-dep-age` is an alias.
`deno approve-scripts` records approved npm lifecycle scripts as `allowScripts`.
`deno audit` checks npm and JSR dependencies for known vulnerabilities.
`deno audit fix` upgrades affected npm dependencies to the nearest patched
versions within declared constraints; review the separately reported packages
that need upgrades outside those constraints. `--socket` is experimental.
## Compile, bundle, publish, and deploy
Embed assets with `deno compile --include ./names.csv --include ./data/ main.ts`
and read them through filesystem APIs relative to `import.meta.dirname`.
`--include-as-is` embeds assets verbatim. `--self-extracting` unpacks embedded
files on first run. The unstable `deno compile --bundle` bundles before embedding.
`deno compile .` detects supported framework projects, runs `deno task build`,
and generates a standalone entry point. `deno compile --watch --output app main.ts`
rebuilds on source changes. Dynamically importing local files from disk in a
compiled executable checks read permission; grant paths with `deno compile --allow-read`.
The experimental `deno bundle` bundles JavaScript and TypeScript, including npm
and JSR dependencies. `deno bundle --outdir dist index.html` bundles referenced
scripts and links imported CSS with content-hashed asset filenames.
The experimental `Deno.bundle()` API requires `--unstable-bundle` and honors
the calling runtime's file permissions.
`deno bundle mod.ts --outdir dist --declaration` emits JavaScript and declarations.
`deno transpile greeter.ts -o greeter.js` emits JavaScript while preserving specifiers.
`deno pack --output my-package.tgz` builds an npm-publishable tarball from exports
declared in `deno.json`, emitting JavaScript, declarations, and an ESM manifest.
Run `deno publish` at the workspace root to publish in dependency order.
`"publish": false` prevents a package from being published to JSR.
Workspace publishing continues after a package fails, so a failed command can
leave some packages published. `deploy.include` and `deploy.exclude` control uploads.
## Tests, lint, and formatting
Use `Deno.test.beforeAll()`, `afterAll()`, `beforeEach()`, and `afterEach()` for
native lifecycle hooks. `t.assertSnapshot()` stores snapshots without requesting
filesystem permission for the snapshot path; `deno test -u` regenerates them.
`Deno.test.each(cases)(name, fn)` registers a filterable test for each case.
`deno test --changed` selects tests for uncommitted changes;
`--changed=origin/main` compares since branching, and `--related=src/util.ts`
selects tests depending on a file. Lockfile, config, import-map, or manifest
changes trigger a full run. `--shard=2/3` selects the second of three groups.
`deno test --retry=2` permits two extra attempts on failure;
`--repeats=5` requires five extra runs to pass. Per-test `retry` overrides the CLI.
`deno test --coverage --coverage-threshold=90` fails on a coverage shortfall.
Use `--coverage-raw-data-only` to collect raw data without an automatic report.
The unstable lint plugin API loads local modules and `jsr:` or `npm:` packages
through `lint.plugins`. The `recommended` set includes `no-unversioned-import`;
the automatic `workspace` set's `no-import-prefix` flags inline `npm:`, `jsr:`,
and `https:` specifiers. Declare those dependencies in a manifest and import by bare name.
Formatting precedence is CLI flags, then `deno.json`, then `.editorconfig`,
then built-in defaults. `deno fmt --check --fail-fast` stops at the first failure.
With no paths or config, formatting asks for confirmation in an interactive
terminal; use `deno fmt .` to explicitly format the directory in noninteractive runs.
## Tasks, type checking, and runtime features
Task `dependencies` run prerequisites, parallelize independent tasks, run shared
prerequisites once, and reject cycles. `deno task --recursive --jobs 1 build`
runs workspace tasks sequentially; `--if-present` succeeds for a missing task.
Task `files` and optional `output` globs enable caching when an input file matches.
`deno check` with no arguments checks the current directory.
`deno check --watch main.ts` repeats checks on changes; `--check-js` enables
JavaScript checking. `--unstable-tsgo` opts into the experimental checker.
The language server picks up `tsconfig.json` changes as soon as the file changes.
Text imports with `with { type: "text" }` are stable; bytes imports still require
`--unstable-raw-imports`. CSS imports with `with { type: "css" }` use that flag
to produce constructable `CSSStyleSheet` objects. `Temporal` is stable;
remove `--unstable-temporal`. WebAssembly supports typed imports and `import source`.
OpenTelemetry is stable: drop `--unstable-otel` and set `OTEL_DENO=1`.
The integration instruments `console.log()`, `Deno.serve()`, and `fetch()` and
supports custom metrics and spans through `npm:@opentelemetry/api`.
Desktop apps are experimental. `deno desktop main.ts` opens a native window;
without an entry point it detects and builds a supported framework project.
The system webview is the default backend; `--backend cef` bundles Chromium.
`Deno.BrowserWindow`, `Deno.Tray`, and desktop packaging details are in the desktop reference.