Deno package manager

Deno is a secure runtime for JavaScript and TypeScript.

Deno lets you use third party written scripts and modules but does not currently offer any official package manager like NPM or Yarn, it instead deals with third party packages a bit differently.

It uses built-in system to cache third party scripts and modules. You can change the cache directory with the help of the DENO_DIR environment variable.

A good example of how this caching works, if file foo.ts requests a third party module it will save the module in the cache and then on the second call use the cache, now if we have boo.ts our second file importing the same module, it will use the cached file.

The regular way of importing third party modules is use of url import, example below.

import { serve } from "https://deno.land/std@0.59.0/http/server.ts";

A quick update to this article, in the initial stages of development, there was no package manager, but now Deno has DPM, Deno’s Package Manager, which is like NPM.

DPM stores the dependencies list in deps.json and stores the modules in the deno_modules folder and uses similar commands like NPM.

To install modules using DPM, you can run.

dpm i <module_name>

You can read more about DPM here.

Here is the official list of third-party packages and modules of Deno.

Here is a GitHub issue discussion on implementation of a package manager.

Leave a Comment