bun install
Superfast Node.js-compatible package manager. Drop into any JavaScript project with a package.json
to instantly speed up your development workflow.
curl -fsSL https://bun.sh/install | bash
Supported on macOS, Linux, and Windows
Bun
pnpm
npm
Yarn
Installing dependencies from cache for a Remix app.
View benchmark
Bun's package manager is intended for use as a standalone tool, regardless of whether you're using the Bun runtime. It'll work in any project with a package.json
, and it supports workspaces, git/http/tarball dependencies, custom registries, and more.
Workspaces are supported out of the box. Bun reads the workspaces
key from your package.json
and installs all of your workspace packages in a single pass.
When you install a package, Bun downloads it into a global package cache. On all future installs, Bun will check the cache first to avoid unnecessary re-downloading.
When writing files from the cache into node_modules
, Bun uses the fastest system calls available on your operating system. This is dramatically faster than naively symlinking from a global cache like pnpm
.
Bun's API will look familiar to any users of npm
, pnpm
, or yarn
. Install all dependencies for a big project. Add or remove a production, dev, or peer dependency. Specify versions, version ranges, or tags.
After installation, Bun creates a binary bun.lockb
file. The binary format makes reading and parsing much fast than JSON- or Yaml-based lockfiles. The lockfile stores the resolved versions of each dependency and metadata about the resolved dependency tree, making future installs nearly instantaneous.
Bun doesn't run postinstall
scripts willy nilly. A set of popular packages are automatically pre-verified; other packages can be allow-listed using the privilegedDependencies
field in your package.json
.