Comment by mahboi
2 months ago
This doesn't seem like a big deal. Don't you just npm install whatever you need and then change the import names?
2 months ago
This doesn't seem like a big deal. Don't you just npm install whatever you need and then change the import names?
I don't want the install step. That's redundant. Just a .ts script I can run via `deno run bla.ts` and which directly pulls in any dependency it needs from the web.
Is it?
It's a different mental model I'd say. Specifically: First, I add the part to the pile, then I wire it up.
I wouldn't call it redundant to explicitly spell out what actually happens. If anything, I'd call it good to remind people that they are adding something into their scope of responsibility.
There are use cases like small scripts where people just want a single js file. So the top of that file basically functions as the package.json.
Bun has auto-install for you, but you do have to enable it.
Deno's is slicker. Deno's built-in LSP works with the automatically installed package's types.
I understand the point of this, just saying an existing codebase importing things this way doesn't seem all that hard to convert if you need to get off Deno.
> and which directly pulls in any dependency and exploit
Fix't it for ya.
You can pin versions. If you aren't, you have the same issue with regular npm.
3 replies →
Well, nobody is supporting that any more. So you either support it yourself or stop using it.
That wasn't the question though