new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Bun · Package manager · all subjects

patch

10 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

bun patch command purpose

bun patch persistently patches packages in node_modules in a maintainable, git-friendly way without vendoring the entire package.

bun patch generates .patch files

.patch files are generated by bun patch and automatically applied to dependencies in node_modules on install.

Patch files can be committed to repository

.patch files can be committed to your repository and reused across installs, projects, and machines.

patchedDependencies in package.json

patchedDependencies in package.json keeps track of patched packages.

bun patch preserves Global Cache integrity

bun patch patches packages in node_modules while preserving the integrity of Bun's Global Cache.

bun patch step 1: prepare package for patching

Use bun patch <pkg> to prepare the package for patching. This ensures the package folder in node_modules contains a fresh copy with no symlinks or hardlinks to Bun's cache. The command accepts a package name (e.g., bun patch react), a package name with version (e.g., bun patch react@17.0.2), or the path to the package (e.g., bun patch node_modules/react).

bun patch step 2: test changes locally

After running bun patch <pkg>, you can edit the package in node_modules directly. bun patch makes this safe by re-creating an unlinked clone of the package in node_modules and diffing it against the original package in the Global Cache.

bun patch --commit syntax and flags

To commit patch changes, run bun patch --commit <path or pkg>. You can supply the path to the patched package (e.g., bun patch --commit node_modules/react), the package name and optionally the version (e.g., bun patch --commit react@17.0.2), or use the --patches-dir flag to choose the directory to store patch files (e.g., bun patch --commit react --patches-dir=mypatches).

bun patch-commit compatibility

bun patch-commit is available as an alias for compatibility with pnpm.

bun patch --commit generates patch file

When running bun patch --commit, Bun generates a patch file in patches/, updates package.json and lockfile, and starts using the patched package.

Give your agent this brain