@zuke/bun

← API reference

`@zuke/bun` — typed `BunTasks` wrappers for the `bun` CLI, for use in Zuke

Symbols

# BunAddSettings class
class BunAddSettings extends BunSettings

Settings for bun add.

MemberSignatureDoc
packages packages(...specs: string[]): this Package specs to add (required).
dev dev(): this Add to devDependencies (--dev).
optional optional(): this Add to optionalDependencies (--optional).
exact exact(): this Pin the exact version (--exact).
global global(): this Install globally (--global).
# BunInstallSettings class
class BunInstallSettings extends BunSettings

Settings for bun install.

MemberSignatureDoc
production production(): this Install without devDependencies (--production).
frozenLockfile frozenLockfile(): this Fail if the lockfile is out of date (--frozen-lockfile).
# BunRemoveSettings class
class BunRemoveSettings extends BunSettings

Settings for bun remove.

MemberSignatureDoc
packages packages(...names: string[]): this Package names to remove (required).
# BunRunSettings class
class BunRunSettings extends BunSettings

Settings for bun run.

MemberSignatureDoc
script script(name: string): this The package.json script to run (required).
scriptArgs scriptArgs(...args: Array<string | number>): this Arguments forwarded to the script.
# BunSettings class
class BunSettings extends ToolSettings

Base for all bun subcommand settings: binary is bun from PATH.

# BunTasks const
const BunTasks: BunTasksApi

Typed task functions for the bun CLI.

# BunTasksApi interface
interface BunTasksApi

The shape of BunTasks.

MemberSignatureDoc
install install(configure?: Configure<BunInstallSettings>): Promise<CommandOutput> Install dependencies: bun install.
add add(configure?: Configure<BunAddSettings>): Promise<CommandOutput> Add dependencies: bun add.
remove remove(configure?: Configure<BunRemoveSettings>): Promise<CommandOutput> Remove dependencies: bun remove.
run run(configure?: Configure<BunRunSettings>): Promise<CommandOutput> Run a package.json script: bun run.
x x(configure?: Configure<BunXSettings>): Promise<CommandOutput> Execute a package binary: bun x (bunx).
test test(configure?: Configure<BunTestSettings>): Promise<CommandOutput> Run the test suite: bun test.
# BunTestSettings class
class BunTestSettings extends BunSettings

Settings for bun test.

MemberSignatureDoc
paths paths(...patterns: string[]): this Test file or directory patterns to run; omit to run all tests.
coverage coverage(): this Collect coverage (--coverage).
bail bail(): this Stop after the first failure (--bail).
# BunXSettings class
class BunXSettings extends BunSettings

Settings for bun x (the bunx package runner).

MemberSignatureDoc
command command(name: string): this The package binary to execute (required).
execArgs execArgs(...args: Array<string | number>): this Arguments forwarded to the command.