What happens if I don't use the "npm:" import specifier when importing from npm? #27344
-
How does Deno handle imports when I do something like this: import { v7 } from "uuid"; It works but I'm wondering what happens behind the scenes. This is important for people who want to easily migrate from node to Deno, or who want to write code that works for both runtimes. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Deno looks for
It will error when a function that is unsupported is used, so at runtime. |
Beta Was this translation helpful? Give feedback.
Deno looks for
deno.json
andpackage.json
files in you CWD and up the parent directory tree. If it finds either (or both) of these files it will useimports
anddependencies
mappings to figure out what's the import, you can read more about it here: https://docs.deno.com/runtime/fundamentals/modules/It will error when a function that is unsupported is used, so at runtime.