block_hacks
block_hacks2y ago

How can I import https://github.com/ensdomains/ensjs-v3/tree/main in my deno

This is npm package. I want to use it in my deno project. How can I achive it? I am trying this: import { ENS } from "https://raw.githubusercontent.com/ensdomains/ensjs-v3/main/packages/ensjs/src/index.ts"; However, I am having error: error: Relative import path "@ethersproject/contracts" not prefixed with / or ./ or ../ at https://raw.githubusercontent.com/ensdomains/ensjs-v3/main/packages/ensjs/src/index.ts:4:8
3 Replies
sakuta
sakuta2y ago
maybe you can import it via esm.sh:
https://esm.sh/gh/ensdomains/ensjs-v3@main/packages/ensjs/src/index.ts
https://esm.sh/gh/ensdomains/ensjs-v3@main/packages/ensjs/src/index.ts
@block_hacks if it uses native node modules, then the npm: specifier would be another suggestion, but i recommend using esm.sh instead
block_hacks
block_hacksOP2y ago
same error for esm.sh how can I use it with npm:? do you have code sample
sakuta
sakuta2y ago
just
import package from 'npm:package_name'
import package from 'npm:package_name'
as documented here: https://deno.com/manual@v1.33.1/node/npm_specifiers