Where Can I find Deno Third Party Modules?

Nick Scialli May 24, 2020🚀 1 minute read

If you're enjoying this blog, please consider one or both of the following:

deno logo

As we explore the Deno ecosystem, we need to know where we can locate third party modules.

Where to Go

If you’re looking for Deno third party modules, look no further than https://deno.land/x!

deno.land/x is self-described as follows:

deno.land/x is a URL rewriting service for Deno scripts. The basic format of code URLs is https://deno.land/x/MODULE_NAME@BRANCH/SCRIPT.ts. If you leave out the branch, it will default to the module’s default branch, usually master.

How to Find and Use a MySQL ORM Module

deno.land/x has a handy type-ahead search function that helps you find modules. For example, if I’m looking for a MySQL ORM:

mysql search example

Once you’ve found the module you want, you can just import the correct URL in the file you’re using it in.

import { Database } from 'https://deno.land/x/denodb/mod.ts';

Consider Specifying a Version!

If you recall from the quote above, we can optionally specify a branch name in our import statement (e.g., https://deno.land/x/MODULE_NAME@BRANCH/SCRIPT.ts).

We should absolutely do this! If you’re familiar with nodejs development, it would seem like a really bad idea to not pin down the versions of our dependencies. Therefore, let’s amend our import to make sure we pin down the version of denodb that we’re using.

import { Database } from 'https://deno.land/x/denodb@v1.0.0/mod.ts';

And there we have it! We now know how to find third party modules, importing them into our projects, and pinning down the correct version.

Nick Scialli

Nick Scialli is a software engineer at the U.S. Digital Service.

Subscribe to the mailing list!

If you like what I post here, please sign up to get updates and code insights in your inbox. I won't spam you and you can unsubscribe any time!

Powered by Buttondown.