To upgrade:
bun upgrade
bun install
Today is an exciting day. Introducing bun install
– an incredibly fast npm client.
Before I get into perf numbers, consider this especially early.
- workspaces not implemented yet
link:
not implemented yetgithub:
not implemented yetgit:
not implemented yet- Config file where you can set registry and auth tokens is not implemented yet. That means private packages won't really work yet (though it does read
$npm_config_registry
) - The lockfile format may change a little in the coming weeks (which would invalidate existing lockfiles)
- postinstall will not be supported (probably won't be opt-in either).
esbuild
andturbo
get special treatment I'm calling "native bin linking". I plan to write a more generalizable proposal for this that other npm clients can adopt to make shipping binary executables on npm faster & simpler node-gyp
isn't supported yet either, but that will be fixed.
Linux
100x faster npm install for incremental installs. In this case, only react is missing (the cleanup resets node_modules), each package manager has an up-to-date lockfile, and packages have previously downloaded before (disk cache)
20x faster than npm install when node_modules is empty. In this case, each package manager has an up-to-date lockfile and packages have also been downloaded before.
When there are no changes, bun install
is 100x faster than npm install
macOS
Note: currently macOS installs are single-threaded & parallelism may help when there are > 100 packages, so these numbers may improve later
80x faster npm install for incremental installs.
4x faster npm install when there is no node_modules folder
When there are no changes, 80x faster than npm install
Autocomplete
Thanks to @evanwashere, bun add
has autocomplete for the top 10,000 npm packages. It also searches your shell's history to complete from.
Fish completions:
Why is it faster?
I will do a longer write up on why it's faster. Zig is part of that, but a lot of work went into data layout, the lockfile format, the https client, the manifest cache format, and a lot of other stuff.