sander
sander

Reputation: 1654

How to find a module in deno?

I'm trying to follow the documentation on the page:

https://orm.drizzle.team/docs/get-started-sqlite

In the documentation it has this code snippet:

import { drizzle } from 'drizzle-orm/libsql';

However, I'm using Deno and I'm trying to use the recommended way of importing modules which is either via URL or import_map.json, the issue is that I can't seem to find where to actually import that {drizzle} from since on the page https://deno.land/x/[email protected]/mod.ts there only exists a drizzle function inside the postgres package which I don't think I'm supposed to use since I am using Turso.

How am I supposed to find the url for the 'drizzle-orm/libsql' or am I missing something here?

I have also tried using esm.sh to import it and the IDE gives me 3 options to import from, they all are using the postgres version, so it seems that this not yet available for deno?

Upvotes: 1

Views: 288

Answers (1)

sander
sander

Reputation: 1654

For anyone else stumbling upon this. You can actually import npm packages if you use the 'npm' prefix. This should work for all packages.

Example:

import { drizzle } from 'npm:drizzle-orm/postgres-js';

Upvotes: -1

Related Questions