logoalt Hacker News

dhamiditoday at 12:15 PM4 repliesview on HN

This:

    node + npm + vitest + vite
Turns into:

    bun
That's the benefit

Replies

stevefan1999today at 12:42 PM

I rather replace bun with deno, given that now both bun and deno are written in Rust, and Deno have even more node compatibility than bun. Deno and Node both runs on V8, while Bun runs on JSC, and Deno has a killer feature that you don't have to even run npm install to use package, you can just top-level import or await import an URL (given that you allowed it with a command prompt or bypass it competely with -A but discouraged).

I've used Deno, CucumberJS and Playwright to write E2E test suites. Zero npm install and not even deno.json or package.json

Octoth0rpetoday at 12:24 PM

Throwing out a couple more benefits: bun is faster than node, dramatically so in some specific cases (websockets). Bun also has been doing a great job at building out core libs that probably don't make sense for node, such as the native inbuilt sqlite module, thereby reducing your dependency graph.

People shit on the node/npm ecosystem relentlessly for the typical inauditable deep dependency graph, and bun makes substantial improvements to that situation.

Edit: bun recently added an inbuilt api for manipulating images (resize, change formats, etc). Another good example of them adding native/faster functionality that replaces significant dependencies (in this case, likely sharp: https://www.npmjs.com/package/sharp?activeTab=versions)

chuckadamstoday at 12:44 PM

To say nothing of `bun install` being about 50 times faster than npm, and disabling most post-install hooks by default.