# Bub

[Bun](https://bun.sh/) is a fast JavaScript all-in-one toolkit

## Install

```shell
brew install oven-sh/bun/bun
# Upgrading bun itself
bun upgrade
```

Add `~/.bun/bin` to your $PATH in the `~/.zshrc` file

```shell
# verify
bun --version
bun --help
```

## Uninstall

```shell
brew uninstall bun
rm -rf ~/.bun # for macOS, Linux, and WSL
```

## Scaffold

To scaffold a new project:

```shell
mkdir quickstart
cd quickstart
bun init
```

To install the TypeScript definitions for Bun's built-in APIs, install bun-types.

```shell
bun add -d bun-types # dev dependency
```

In the repo root, set `.gitattributes` and `git config` as documented [here](https://bun.sh/docs/install/lockfile)

## Utils

package manager

```shell
bun pm bin
bun pm bin -g
bun pm ls
bun pm cache
bun pm cache rm

bun update
```

```shell
bun run env
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://xmlking.gitbook.io/macos-setup/platforms/node/bun.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
