Hacker News new | ask | show | jobs
by Rizu 512 days ago
i am not a JavaScript programmer, but can someone explain exactly what bun does ? does it compile JavaScript and target a backend like LLVM equivalent for the browser ?
3 comments

> what bun does ?

It installs npm packages, it executes JS and TS code, it bundles code for front end, it runs tests. Plus it has a lot of random pieces related to this development, like integrated database access.

Compare it to node, npm, webpack, and jest, all in one, and whatever the guy dreams of. It's certainly fast and offers great DX, but I wouldn't bet on it to stay around for, say, 5 years.

It doesn't really do anything for the browser. It provides a really fast runtime for JS to run in a server, a stdlib for http, crypto, and filesystem (among others) that JS lacks, a bundler for JS projects to go to a browser and a compiler for typescript to JS, among a few other things.
Bun is a build tool and code runner primarily. It can run a tsx or js file, and it can do bundling or the compilation of TypeScript into regular JS. It also manages packages and can run tests. It aims (I think) to be a node compatible replacement for node.