Skip to main content
On this page

deno link

The deno link command points your project at a local copy of a JSR package so you can develop against it in place of the published version. It is the command-line equivalent of editing the links array in deno.json by hand, and mirrors the workflow of npm link or bun link.

Linking a package Jump to heading

Pass the path to a local package directory:

>_
deno link ../my-local-pkg

The target must be a directory containing a deno.json or package.json with a name field, so Deno knows which package it stands in for. Deno appends the relative path to the links array in the nearest deno.json (creating the array if it does not exist) and then installs dependencies. The linked package is importable by its bare name, just like a workspace member, so no imports entry is added.

Linking the same path again has no additional effect. You can link several packages in one command:

>_
deno link ../pkg-a ../pkg-b

Use deno unlink to stop using the local copy:

>_
deno unlink ../my-local-pkg
Command line usage:
deno link [OPTIONS] [paths]...

Link a local JSR package into the current project for development.

deno link ../my-local-pkg

Each path must be a directory containing a deno.json with a JSR-style "name" field. The path is appended to the "links" array in the nearest deno.json, and modules imported by that package's name resolve to the local copy instead of the registry.

To stop using the local copy:

deno unlink ../my-local-pkg
deno unlink @scope/name

Dependency management options Jump to heading

--frozen<BOOLEAN>optional
Jump to heading

Error out if lockfile is out of date.

--lock<FILE>optional
Jump to heading

Check the specified lock file. (If value is not provided, defaults to "./deno.lock").

Disable auto discovery of the lock file.

Options Jump to heading

--lockfile-only
Jump to heading

Install only updating the lockfile.

Last updated on

Did you find what you needed?

Edit this page
Privacy policy