LinuxCommandLibrary

bun-outdated

List outdated Bun dependencies

TLDR

List all outdated dependencies in the current project

$ bun outdated
copy

Check if a specific package is outdated
$ bun outdated [package]
copy

List outdated dependencies matching a glob pattern
$ bun outdated "[pattern]"
copy

Show outdated dependencies for specific workspaces
$ bun outdated --filter "[workspace_pattern]"
copy

Recursively check all workspaces in a monorepo
$ bun outdated --recursive
copy

SYNOPSIS

bun outdated [flags]
bun outdated [package-name...]

PARAMETERS

-h, --help
    Displays help information for the bun outdated command.

--json
    Outputs the list of outdated packages in JSON format, suitable for programmatic parsing.

--all
    Shows all dependencies, including those that are up-to-date, alongside outdated ones.

--filter pattern
    Filters the list of packages to check, only including those whose names match the provided pattern.

--workspace path
    Specifies a particular workspace within a monorepo to check for outdated packages.

--strict
    Exits with a non-zero status code (typically 1) if any outdated packages are found, useful for CI/CD pipelines.

--cwd path
    Sets the current working directory for the command execution.

--production
    Only checks production dependencies (those listed in dependencies, not devDependencies).

--development
    Only checks development dependencies (those listed in devDependencies, not dependencies).

DESCRIPTION

The bun outdated command scans your project's package.json file and its lockfile (bun.lockb) to identify dependencies that have newer versions available in their respective registries. It provides a clear, tabular summary showing the currently installed version, the 'wanted' version (the highest version compatible with your package.json's semver range), and the absolute 'latest' available version. This command is crucial for maintaining project health, ensuring you're aware of available updates for bug fixes, performance improvements, and security patches without automatically applying them. It helps developers make informed decisions about when and what to update, facilitating proactive dependency management within Bun-powered JavaScript and TypeScript projects.

CAVEATS

The accuracy of bun outdated depends on a valid package.json and bun.lockb file. It relies on the configured package registries to fetch the latest version information. This command only reports; it does not perform any updates. Updates must be done manually using bun update or by modifying package.json and running bun install.

OUTPUT FORMAT

By default, bun outdated displays a table with columns: Package, Current (installed version), Wanted (highest version satisfying package.json's semver), Latest (absolute latest registry version), and Type (Dependencies or Dev Dependencies). The Wanted version is particularly useful as it indicates the maximum safe upgrade within your defined version ranges. Using the --json flag provides a machine-readable JSON object with this information.

USAGE WITH SPECIFIC PACKAGES

You can check for outdated versions of specific packages by providing their names as arguments after the command, for example: bun outdated react vue. This is useful when you only want to review a subset of your project's dependencies.

HISTORY

The bun outdated command is an integral part of Bun, a new JavaScript runtime and toolkit launched by Jarred Sumner. Bun was first publicly released in 2022, with its 1.0 version debuting in September 2023. As Bun aims to be a comprehensive, high-performance replacement for Node.js and existing package managers like npm and yarn, the inclusion of a robust outdated command was a fundamental feature from its early development. It mirrors similar functionality in other package managers, providing developers with a familiar and essential tool for dependency maintenance in the Bun ecosystem, reflecting Bun's rapid evolution and commitment to a complete developer experience.

SEE ALSO

bun update(1), bun install(1), bun add(1), npm outdated(1), yarn outdated(1), pnpm outdated(1)

Copied to clipboard