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

bunx: package execution

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

bunx is an alias for bun x

bunx is an alias for bun x. The bunx CLI is auto-installed when you install bun.

bunx purpose and equivalent tools

bunx is used to auto-install and run packages from npm. It is Bun's equivalent of npx or yarn dlx.

bunx speed advantage

bunx is roughly 100x faster than npx for locally installed packages due to Bun's fast startup times.

bunx package lookup and caching

bunx checks for a locally installed package first, then falls back to auto-installing it from npm. bunx stores installed packages in Bun's global cache for future use.

bunx passing arguments and flags

To pass additional command-line flags and arguments through to the executable, place them after the executable name. For example: bunx my-cli --foo bar

bunx respects shebangs by default

By default, Bun respects shebangs. If an executable is marked with #!/usr/bin/env node, Bun spins up a node process to execute the file.

bunx --bun flag to run with Bun runtime

To run the executable with Bun's runtime instead of respecting the shebang, pass the --bun flag. The --bun flag must occur before the executable name. For example: bunx --bun my-cli

bunx --bun flag placement requirement

The --bun flag must occur before the executable name. Flags that appear after the executable name are passed through to the executable. bunx --bun my-cli is correct; bunx my-cli --bun is incorrect.

bunx --package or -p flag

The --package <pkg> or -p <pkg> flag runs a binary from a specific package. This is useful when the binary name differs from the package name. Examples: bunx -p renovate renovate-config-validator and bunx --package @angular/cli ng

bunx with bun shebang forces Bun execution

To force a script to always run with Bun, give it a bun shebang by using #!/usr/bin/env bun at the beginning of the script.

Package executables declared in bin field

Packages declare executables in the "bin" field of their package.json. These are known as package executables or package binaries.

Package executable example with bin field

A package.json can declare executables like this: {"name": "my-cli", "bin": {"my-cli": "dist/index.js"}}

Shebang line for executable files

Package executables are commonly plain JavaScript files marked with a shebang line naming the program that should run them. For example: #!/usr/bin/env node

Give your agent this brain