LinuxCommandLibrary

bun-i

Install project dependencies

TLDR

View documentation for the original command

$ tldr bun install
copy

SYNOPSIS

bun install [packages...] [options]
bun i [packages...] [options]

PARAMETERS

packages...
    Optional. Specifies individual packages to install. If omitted, installs all dependencies listed in package.json.

--production
    Installs only production dependencies, excluding devDependencies.

--dev
    Installs only development dependencies, excluding dependencies.

--frozen
    Ensures the lockfile (bun.lockb) matches the package.json exactly, failing if a discrepancy is found. Useful for CI/CD environments.

--dry-run
    Performs all necessary checks and calculations but does not write any files to disk.

--force
    Forces re-download of packages, even if they are already in the cache, and rebuilds project dependencies.

--no-save
    Prevents installed packages from being added to the package.json dependencies (e.g., dependencies, devDependencies).

--save-exact, -E
    Installs packages with an exact version, instead of using a caret (^) or tilde (~) range.

--global, -g
    Installs a package globally on the system (often in ~/.bun/install/global).

--workspace
    Limits the installation to a specific workspace in a monorepo.

--silent, -s
    Suppresses progress output and most logs, showing only errors.

DESCRIPTION

bun-i is commonly understood as a shorthand or alias for the bun install command, much like npm i or yarn i are for their respective package managers. While bun-i itself is not a standalone Linux command or a direct part of the bun executable's top-level flags, it effectively refers to the operation of installing project dependencies using the Bun JavaScript runtime.

Bun is an incredibly fast, all-in-one JavaScript runtime designed to be a drop-in replacement for Node.js. Its install command (invoked as bun install or bun i) is optimized for speed, performing dependency resolution and installation significantly faster than traditional package managers like npm or Yarn. It reads package.json files, resolves dependencies, and populates the node_modules directory with the required packages, also generating a bun.lockb lockfile for reproducible builds. It supports various package sources, including npm registry, git repositories, and local paths.

CAVEATS

The term bun-i is not a standard, executable command on its own. It's an informal reference or common alias for bun install or bun i. Bun itself is a relatively new runtime; while highly performant, it may have compatibility quirks with older Node.js projects or specific native modules. It's actively under development, so breaking changes or new features can occur rapidly.

INTERPRETATION OF 'BUN-I'

It's important to clarify that bun-i is not an actual executable command name. Rather, it's a phonetic or stylistic interpretation of bun i, which is the common, shorter alias for bun install. When users refer to bun-i, they almost universally mean the dependency installation functionality provided by the Bun runtime.

LOCKFILE (<I>BUN.LOCKB</I>)

Unlike package-lock.json or yarn.lock, Bun uses a binary lockfile called bun.lockb. This file is optimized for speed and efficiency, contributing to Bun's rapid installation times and ensuring reproducible builds by precisely locking down the versions of all dependencies.

HISTORY

The Bun runtime, created by Jarred Sumner, was publicly launched in 2022, with its install command being a core feature from the outset. Its development has focused on modern JavaScript tooling, aiming to replace Node.js, npm, Yarn, webpack, and other tools with a single, highly optimized, and integrated platform written in Zig. The bun install command quickly gained traction due to its unparalleled speed in installing dependencies, which is a common bottleneck in JavaScript development workflows. The shorthand bun i (and by extension, the informal bun-i) naturally emerged, mirroring patterns from other package managers like npm i.

SEE ALSO

npm-install(1), yarn-install(1), pnpm-install(1), bun(1)

Copied to clipboard