ciscoheat
ciscoheat3w ago

When to use deno add compared to import with a prefix?

As the title says, I can import like this:
import { parse } from "jsr:@std/csv/parse";
import { parse } from "jsr:@std/csv/parse";
And it will work, but there is also deno add, which I'm recommended to use if I import from @std/csv/parse. When should I use deno add?
2 Replies
marvinh.
marvinh.3w ago
Rule of thumb: Use inline jsr:/ npm: specifiers for simple scripts and define deps in deno.json for more complex projects. Being able to look up all dependencies of a project in one file makes it easier to manage them and automate it via tooling like deno outdated
ciscoheat
ciscoheatOP3w ago
Ok, thank you!

Did you find this page helpful?