Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Deno

deps-deno provides LSP support for Deno projects, which can depend on packages from two different registries in the same imports map.

Basics

Manifest filedeno.json or deno.jsonc
Lock file (in-use version)deno.lock (schema versions 3, 4 and 5), located next to the manifest or in an ancestor directory
Registryjsr: specifiers resolve against JSR (jsr.io/api.jsr.io); npm: specifiers resolve against the same npm registry client deps-npm uses
Version syntaxnode-semver ranges, same as npm
{
  "imports": {
    "@std/fs": "jsr:@std/fs@^1.0.0",
    "lodash": "npm:lodash@^4.17.21"
  }
}

A dependency’s scheme prefix (jsr: or npm:) determines which registry client serves its hover, completion, and diagnostics — both schemes get the identical LSP experience version data otherwise gets (outdated/unsatisfiable diagnostics, inlay hints, code actions), just sourced from different upstream registries.

Lock Files

deno.lock supplies the in-use version for both jsr: and npm: imports, so hover, inlay hints and OSV matching use the version Deno resolved instead of the manifest range. deno.json and deno.jsonc read the same file. The lock is searched in the manifest’s directory and then its ancestors (the same depth as npm), so a nested deno.json without its own deno.lock picks up the parent’s.

  • Entries are matched by package name, not by the exact manifest specifier: the Deno CLI normalizes the keys of the lock’s specifiers map (^1.0.0 becomes 1, an unversioned request becomes *, requests that resolve identically merge), and subpaths such as jsr:@std/path@^1/posix are not part of the key.
  • npm peer-dependency suffixes (18.3.1_react@18.3.1) are stripped to the plain version.
  • The remote and workspace sections are ignored; a lock with only remote entries resolves nothing.
  • A lock whose version is missing or is not "3", "4" or "5" is rejected rather than misread.

Non-Registry Dependency Sources

A deno.json/deno.jsonc imports entry resolved to a private npm scope via .npmrc is classified as a non-registry dependency instead of defaulting to registry.npmjs.org (resolves #1202). This .npmrc resolution now shares npm’s cached ancestor-config lookup and live RegistryAccessPolicy instead of re-reading .npmrc from disk with a hardcoded policy on every parse, and participates in the same live-config reparse scope as npm — a registries.workspace_registries change reaches an already-open deno.json the same way it reaches package.json (resolves #1212).

A scope-overridden npm: import is fully fetchable, not just correctly classified: hover, diagnostics, completion, and inlay hints query the resolved alternate registry — the same deps-npm registry client and fail-closed routing package.json uses for the identical .npmrc entry — instead of silently behaving as an unresolved dependency (resolves #1227).

Vulnerability scanning. An npm: specifier routed by a top-level registry= entry is not sent to OSV, because the registry cannot be verified as a mirror of npmjs, and it is reported as “Vulnerability data not checked” exactly like the same dependency in package.json (see npm). A specifier routed by an @scope:registry= entry is treated as private and skipped silently.

Release-Freshness Coverage

jsr: specifiers get full freshness coverage at zero extra request cost — better than both NuGet and npm. JSR’s meta.json (the same response JsrRegistry::get_versions already fetches for the version list) carries a per-version createdAt timestamp, so published_at is populated unconditionally with no separate fetch and no TTL to tune. npm: specifiers in deno.json inherit npm’s own freshness behavior exactly, since DenoRegistry delegates them to the same deps-npm registry client package.json uses.

Yanked Versions

jsr: specifiers get a genuine per-version yanked signal from JSR’s meta.json; npm: specifiers delegate to npm’s own deprecated-sourced signal, including its restrictions — see Yanked Versions & Vulnerabilities for the full cross-ecosystem picture.

Licensing

Deno’s license comes from a per-ecosystem background pre-fetch (JSR’s per-version license field, jsr: specifiers only) rather than the hot-path registry response — see License Hover for the full cross-ecosystem picture.