LinuxCommandLibrary

bun-patch

Apply patches to dependencies

TLDR

Prepare a package for patching

$ bun patch [package]
copy

Prepare a specific version of a package
$ bun patch [package]@[version]
copy

Prepare a package located at a specific path
$ bun patch [path/to/package]
copy

Generate a patch file for changes made to a package
$ bun patch --commit [path/to/package]
copy

Generate a patch file and store it in a custom directory
$ bun patch --commit [path/to/package] --patches-dir [path/to/directory]
copy

SYNOPSIS

No standard syntax: bun patch [options] [args]
(Not available in official Bun CLI)

PARAMETERS

None official
    No documented parameters as command does not exist

DESCRIPTION

The bun-patch command is not a recognized or built-in subcommand of Bun, the fast all-in-one JavaScript runtime and package manager for macOS, Linux, and Windows. Bun's official CLI includes commands like bun install, bun add, bun run, bun test, bun x, and bun upgrade, but no bun-patch.

Bun users seeking to patch dependencies typically use third-party tools like patch-package (installable via bun add -d patch-package), which allows creating and applying patches to node_modules. Alternatively, Git patches can be applied manually with git apply. If bun-patch refers to a custom script, alias, or plugin in a specific project, its behavior would depend on that implementation.

Bun excels in speed for npm-compatible workflows but lacks native patching. For production patching, consider semantic versioning or forking packages instead.

CAVEATS

Attempting bun patch will result in 'command not found' error. Use patch-package or Git for dependency patches. Bun patches its own installation via bun upgrade.

ALTERNATIVES

Use bun add package@patch:<git-url> for Git patches or patch-package for local mods.

HISTORY

Bun launched in 2022 by Jarred Sumner. As of version 1.1+, no bun-patch added. Patching handled externally.

SEE ALSO

bun(1), npm(1), yarn(1), git-apply(1), patch-package

Copied to clipboard