logoalt Hacker News

flohofwoe • today at 3:35 PM • 3 replies • view on HN

> ...pretty much any functionality provided to deno is available for node as well.

Unfortunately Node still can't do something like this out of the box (AFAIK at least):

    import { Bla } from "npm:bla@^5";
Such direct imports are basically the killer feature of Deno for simple standalone tooling scripts in otherwise non-JS/TS projects, e.g. it made TS a perfect replacement for Python even without a "batteries included" standard library.

Deno also has a builtin TS type checker, linter, formatter, test runner with coverage support, package manager, language server etc etc... In node these are all separate (and often 3rd-party) tools.


Replies

mahboi • today at 5:44 PM

This doesn't seem like a big deal. Don't you just npm install whatever you need and then change the import names?

➕ show 1 reply
ecares • today at 6:27 PM

this one is actually a bad pattern to avoid.

➕ show 1 reply
michaelmior • today at 7:33 PM

FWIW, almost this exact syntax for imports (without the `npm:` prefix) is supported for standalone scripts with Bun.