From 55a9cccac06403fe1486168378246b34a957f0a1 Mon Sep 17 00:00:00 2001 From: Jarred Sumner Date: Thu, 10 Jul 2025 00:10:43 -0700 Subject: [PATCH] bun.sh -> bun.com (#20909) --- .github/ISSUE_TEMPLATE/2-bug-report.yml | 2 +- .../3-typescript-bug-report.yml | 74 +-- .github/workflows/release.yml | 2 +- CONTRIBUTING.md | 4 +- Makefile | 18 +- README.md | 588 +++++++++--------- SECURITY.md | 3 +- bench/expect-to-equal/README.md | 2 +- bench/snippets/dns-prefetch.mjs | 2 +- bench/websocket-server/README.md | 2 +- docs/api/binary-data.md | 2 +- docs/api/cc.md | 2 +- docs/api/dns.md | 6 +- docs/api/fetch.md | 10 +- docs/api/file-io.md | 6 +- docs/api/globals.md | 8 +- docs/api/http.md | 12 +- docs/api/s3.md | 2 +- docs/api/utils.md | 6 +- docs/bundler/fullstack.md | 4 +- docs/bundler/index.md | 16 +- docs/bundler/loaders.md | 10 +- docs/bundler/macros.md | 2 +- docs/bundler/plugins.md | 2 +- docs/bundler/vs-esbuild.md | 10 +- docs/cli/bun-create.md | 6 +- docs/cli/bun-install.md | 2 +- docs/cli/bun-upgrade.md | 2 +- docs/cli/filter.md | 4 +- docs/cli/install.md | 10 +- docs/cli/patch-commit.md | 2 +- docs/cli/run.md | 4 +- docs/cli/test.md | 12 +- docs/ecosystem/express.md | 6 +- docs/ecosystem/react.md | 2 +- docs/guides/binary/arraybuffer-to-array.md | 2 +- docs/guides/binary/arraybuffer-to-blob.md | 2 +- docs/guides/binary/arraybuffer-to-buffer.md | 2 +- docs/guides/binary/arraybuffer-to-string.md | 2 +- .../binary/arraybuffer-to-typedarray.md | 2 +- docs/guides/binary/blob-to-arraybuffer.md | 2 +- docs/guides/binary/blob-to-dataview.md | 2 +- docs/guides/binary/blob-to-stream.md | 2 +- docs/guides/binary/blob-to-string.md | 2 +- docs/guides/binary/blob-to-typedarray.md | 2 +- docs/guides/binary/buffer-to-arraybuffer.md | 2 +- docs/guides/binary/buffer-to-blob.md | 2 +- .../guides/binary/buffer-to-readablestream.md | 2 +- docs/guides/binary/buffer-to-string.md | 2 +- docs/guides/binary/buffer-to-typedarray.md | 2 +- docs/guides/binary/dataview-to-string.md | 2 +- .../binary/typedarray-to-arraybuffer.md | 2 +- docs/guides/binary/typedarray-to-blob.md | 2 +- docs/guides/binary/typedarray-to-buffer.md | 2 +- docs/guides/binary/typedarray-to-dataview.md | 2 +- .../binary/typedarray-to-readablestream.md | 2 +- docs/guides/binary/typedarray-to-string.md | 2 +- docs/guides/ecosystem/express.md | 2 +- docs/guides/ecosystem/neon-drizzle.md | 2 +- .../ecosystem/neon-serverless-postgres.md | 2 +- docs/guides/html-rewriter/extract-links.md | 8 +- .../html-rewriter/extract-social-meta.md | 6 +- docs/guides/http/fetch.md | 4 +- docs/guides/http/file-uploads.md | 2 +- docs/guides/http/hot.md | 2 +- docs/guides/http/server.md | 2 +- docs/guides/http/simple.md | 2 +- docs/guides/http/stream-file.md | 6 +- docs/guides/http/tls.md | 2 +- docs/guides/install/add-dev.md | 2 +- docs/guides/install/add-git.md | 2 +- docs/guides/install/add-optional.md | 2 +- docs/guides/install/add-peer.md | 2 +- docs/guides/install/add-tarball.md | 2 +- docs/guides/install/add.md | 2 +- docs/guides/install/azure-artifacts.md | 2 +- docs/guides/install/custom-registry.md | 4 +- docs/guides/install/git-diff-bun-lockfile.md | 2 +- docs/guides/install/npm-alias.md | 2 +- docs/guides/install/registry-scope.md | 6 +- docs/guides/install/trusted.md | 2 +- docs/guides/install/workspaces.md | 2 +- docs/guides/install/yarnlock.md | 4 +- docs/guides/process/ctrl-c.md | 2 +- docs/guides/process/ipc.md | 4 +- docs/guides/process/nanoseconds.md | 2 +- docs/guides/process/os-signals.md | 2 +- docs/guides/process/spawn-stderr.md | 4 +- docs/guides/process/spawn-stdout.md | 4 +- docs/guides/process/spawn.md | 4 +- docs/guides/process/stdin.md | 2 +- docs/guides/read-file/arraybuffer.md | 2 +- docs/guides/read-file/buffer.md | 2 +- docs/guides/read-file/exists.md | 2 +- docs/guides/read-file/mime.md | 2 +- docs/guides/read-file/stream.md | 2 +- docs/guides/read-file/uint8array.md | 2 +- docs/guides/read-file/watch.md | 2 +- docs/guides/runtime/delete-directory.md | 2 +- docs/guides/runtime/delete-file.md | 2 +- docs/guides/runtime/import-json.md | 2 +- docs/guides/runtime/import-toml.md | 2 +- docs/guides/runtime/read-env.md | 2 +- docs/guides/runtime/set-env.md | 2 +- docs/guides/runtime/shell.md | 2 +- docs/guides/runtime/tsconfig-paths.md | 2 +- docs/guides/runtime/typescript.md | 2 +- docs/guides/runtime/vscode-debugger.md | 2 +- docs/guides/streams/to-array.md | 2 +- docs/guides/streams/to-arraybuffer.md | 2 +- docs/guides/streams/to-blob.md | 2 +- docs/guides/streams/to-buffer.md | 2 +- docs/guides/streams/to-json.md | 2 +- docs/guides/streams/to-string.md | 2 +- docs/guides/streams/to-typedarray.md | 2 +- docs/guides/util/base64.md | 2 +- docs/guides/util/deep-equals.md | 6 +- docs/guides/util/deflate.md | 2 +- docs/guides/util/entrypoint.md | 4 +- docs/guides/util/escape-html.md | 2 +- docs/guides/util/file-url-to-path.md | 2 +- docs/guides/util/gzip.md | 2 +- docs/guides/util/hash-a-password.md | 2 +- docs/guides/util/import-meta-dir.md | 4 +- docs/guides/util/import-meta-file.md | 4 +- docs/guides/util/import-meta-path.md | 4 +- docs/guides/util/javascript-uuid.md | 2 +- docs/guides/util/main.md | 2 +- docs/guides/util/path-to-file-url.md | 2 +- docs/guides/util/sleep.md | 2 +- docs/guides/util/version.md | 2 +- .../util/which-path-to-executable-bin.md | 2 +- docs/guides/websocket/context.md | 2 +- docs/guides/websocket/simple.md | 2 +- docs/guides/write-file/basic.md | 4 +- docs/guides/write-file/blob.md | 4 +- docs/guides/write-file/cat.md | 4 +- docs/guides/write-file/file-cp.md | 4 +- docs/guides/write-file/filesink.md | 2 +- docs/guides/write-file/response.md | 6 +- docs/guides/write-file/stdout.md | 4 +- docs/guides/write-file/stream.md | 4 +- docs/guides/write-file/unlink.md | 2 +- docs/index.md | 2 +- docs/install/lockfile.md | 2 +- docs/install/npmrc.md | 8 +- docs/install/patch.md | 4 +- docs/install/registries.md | 2 +- docs/install/workspaces.md | 6 +- docs/installation.md | 14 +- docs/project/benchmarking.md | 2 +- docs/project/building-windows.md | 4 +- docs/quickstart.md | 2 +- docs/runtime/autoimport.md | 2 +- docs/runtime/bun-apis.md | 72 +-- docs/runtime/debugger.md | 2 +- docs/runtime/env.md | 2 +- docs/runtime/index.md | 38 +- docs/runtime/jsx.md | 2 +- docs/runtime/loaders.md | 6 +- docs/runtime/nodejs-apis.md | 8 +- docs/runtime/plugins.md | 10 +- docs/runtime/typescript.md | 2 +- examples/bun-hot-websockets.js | 2 +- packages/bun-error/index.tsx | 2 +- .../bun/__snapshots__/runner.test.ts.snap | 2 +- packages/bun-lambda/scripts/build-layer.ts | 2 +- packages/bun-plugin-svelte/README.md | 10 +- packages/bun-plugin-svelte/example/App.svelte | 21 +- packages/bun-plugin-svelte/example/index.html | 4 +- packages/bun-plugin-svelte/package.json | 2 +- .../npm/@oven/bun-darwin-aarch64/README.md | 2 +- .../@oven/bun-darwin-x64-baseline/README.md | 2 +- .../npm/@oven/bun-darwin-x64/README.md | 2 +- .../npm/@oven/bun-linux-aarch64/README.md | 2 +- .../@oven/bun-linux-x64-baseline/README.md | 2 +- .../npm/@oven/bun-linux-x64/README.md | 2 +- .../@oven/bun-windows-x64-baseline/README.md | 2 +- .../npm/@oven/bun-windows-x64/README.md | 2 +- packages/bun-release/npm/bun/README.md | 2 +- packages/bun-release/scripts/upload-npm.ts | 4 +- packages/bun-release/src/npm/install.ts | 2 +- packages/bun-types/README.md | 2 +- packages/bun-types/bun.d.ts | 18 +- packages/bun-types/devserver.d.ts | 6 +- packages/bun-types/package.json | 2 +- packages/bun-types/shell.d.ts | 4 +- packages/bun-vscode/README.md | 4 +- packages/bun-vscode/package.json | 2 +- scripts/nav2readme.ts | 4 +- src/bake/bake.zig | 2 +- src/bake/production.zig | 2 +- src/bun.js/api/server/ServerConfig.zig | 6 +- src/cli.zig | 16 +- src/cli/create_command.zig | 2 +- src/cli/discord_command.zig | 2 +- src/cli/init/README.default.md | 2 +- src/cli/init/README2.default.md | 2 +- src/cli/install.sh | 2 +- src/cli/package_manager_command.zig | 2 +- src/cli/pm_trusted_command.zig | 2 +- src/cli/pm_version_command.zig | 2 +- src/cli/run_command.zig | 2 +- src/cli/test_command.zig | 2 +- src/cli/upgrade_command.zig | 6 +- src/codegen/bindgen-lib.ts | 2 +- src/compile_target.zig | 2 +- .../REPLACE_ME_WITH_YOUR_APP_FILE_NAME.html | 2 +- .../PackageManager/CommandLineArguments.zig | 26 +- .../PackageManager/PackageManagerEnqueue.zig | 2 +- src/install/windows-shim/bun_shim_impl.zig | 2 +- src/js/private.d.ts | 2 +- src/windows-app-info.rc | 2 +- test/js/bun/http/bun-serve-routes.test.ts | 6 +- 214 files changed, 749 insertions(+), 771 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/2-bug-report.yml b/.github/ISSUE_TEMPLATE/2-bug-report.yml index a0d51a2bb8..2767cee616 100644 --- a/.github/ISSUE_TEMPLATE/2-bug-report.yml +++ b/.github/ISSUE_TEMPLATE/2-bug-report.yml @@ -12,7 +12,7 @@ body: If you need help or support using Bun, and are not reporting a bug, please join our [Discord](https://discord.gg/CXdq2DP29u) server, where you can ask questions in the [`#help`](https://discord.gg/32EtH6p7HN) forum. - Make sure you are running the [latest](https://bun.sh/docs/installation#upgrading) version of Bun. + Make sure you are running the [latest](https://bun.com/docs/installation#upgrading) version of Bun. The bug you are experiencing may already have been fixed. Please try to include as much information as possible. diff --git a/.github/ISSUE_TEMPLATE/3-typescript-bug-report.yml b/.github/ISSUE_TEMPLATE/3-typescript-bug-report.yml index 3913e25272..bb85f8e6be 100644 --- a/.github/ISSUE_TEMPLATE/3-typescript-bug-report.yml +++ b/.github/ISSUE_TEMPLATE/3-typescript-bug-report.yml @@ -2,44 +2,44 @@ name: 🇹 TypeScript Type Bug Report description: Report an issue with TypeScript types labels: [bug, types] body: -- type: markdown - attributes: - value: | - Thank you for submitting a bug report. It helps make Bun better. + - type: markdown + attributes: + value: | + Thank you for submitting a bug report. It helps make Bun better. - If you need help or support using Bun, and are not reporting a bug, please - join our [Discord](https://discord.gg/CXdq2DP29u) server, where you can ask questions in the [`#help`](https://discord.gg/32EtH6p7HN) forum. + If you need help or support using Bun, and are not reporting a bug, please + join our [Discord](https://discord.gg/CXdq2DP29u) server, where you can ask questions in the [`#help`](https://discord.gg/32EtH6p7HN) forum. - Make sure you are running the [latest](https://bun.sh/docs/installation#upgrading) version of Bun. - The bug you are experiencing may already have been fixed. + Make sure you are running the [latest](https://bun.com/docs/installation#upgrading) version of Bun. + The bug you are experiencing may already have been fixed. - Please try to include as much information as possible. + Please try to include as much information as possible. -- type: input - attributes: - label: What version of Bun is running? - description: Copy the output of `bun --revision` -- type: input - attributes: - label: What platform is your computer? - description: | - For MacOS and Linux: copy the output of `uname -mprs` - For Windows: copy the output of `"$([Environment]::OSVersion | ForEach-Object VersionString) $(if ([Environment]::Is64BitOperatingSystem) { "x64" } else { "x86" })"` in the PowerShell console -- type: textarea - attributes: - label: What steps can reproduce the bug? - description: Explain the bug and provide a code snippet that can reproduce it. - validations: - required: true -- type: textarea - attributes: - label: What is the expected behavior? - description: If possible, please provide text instead of a screenshot. -- type: textarea - attributes: - label: What do you see instead? - description: If possible, please provide text instead of a screenshot. -- type: textarea - attributes: - label: Additional information - description: Is there anything else you think we should know? + - type: input + attributes: + label: What version of Bun is running? + description: Copy the output of `bun --revision` + - type: input + attributes: + label: What platform is your computer? + description: | + For MacOS and Linux: copy the output of `uname -mprs` + For Windows: copy the output of `"$([Environment]::OSVersion | ForEach-Object VersionString) $(if ([Environment]::Is64BitOperatingSystem) { "x64" } else { "x86" })"` in the PowerShell console + - type: textarea + attributes: + label: What steps can reproduce the bug? + description: Explain the bug and provide a code snippet that can reproduce it. + validations: + required: true + - type: textarea + attributes: + label: What is the expected behavior? + description: If possible, please provide text instead of a screenshot. + - type: textarea + attributes: + label: What do you see instead? + description: If possible, please provide text instead of a screenshot. + - type: textarea + attributes: + label: Additional information + description: Is there anything else you think we should know? diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9a1f110a78..a3db1518f4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -202,7 +202,7 @@ jobs: body: | Update `bun-types` version to ${{ steps.bun-version.outputs.BUN_VERSION }} - https://bun.sh/blog/${{ env.BUN_VERSION }} + https://bun.com/blog/${{ env.BUN_VERSION }} push-to-fork: oven-sh/DefinitelyTyped branch: ${{env.BUN_VERSION}} docker: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ef45447465..f9799ba4ea 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,6 +1,6 @@ Configuring a development environment for Bun can take 10-30 minutes depending on your internet connection and computer speed. You will need ~10GB of free disk space for the repository and build artifacts. -If you are using Windows, please refer to [this guide](https://bun.sh/docs/project/building-windows) +If you are using Windows, please refer to [this guide](https://bun.com/docs/project/building-windows) ## Install Dependencies @@ -37,7 +37,7 @@ Before starting, you will need to already have a release build of Bun installed, {% codetabs %} ```bash#Native -$ curl -fsSL https://bun.sh/install | bash +$ curl -fsSL https://bun.com/install | bash ``` ```bash#npm diff --git a/Makefile b/Makefile index 8826aa4ea7..91bb766afa 100644 --- a/Makefile +++ b/Makefile @@ -980,7 +980,7 @@ release-create-auto-updater: .PHONY: release-create release-create: gh release create --title "bun v$(PACKAGE_JSON_VERSION)" "$(BUN_BUILD_TAG)" - gh release create --repo=$(BUN_AUTO_UPDATER_REPO) --title "bun v$(PACKAGE_JSON_VERSION)" "$(BUN_BUILD_TAG)" -n "See https://github.com/oven-sh/bun/releases/tag/$(BUN_BUILD_TAG) for release notes. Using the install script or bun upgrade is the recommended way to install bun. Join bun's Discord to get access https://bun.sh/discord" + gh release create --repo=$(BUN_AUTO_UPDATER_REPO) --title "bun v$(PACKAGE_JSON_VERSION)" "$(BUN_BUILD_TAG)" -n "See https://github.com/oven-sh/bun/releases/tag/$(BUN_BUILD_TAG) for release notes. Using the install script or bun upgrade is the recommended way to install bun. Join bun's Discord to get access https://bun.com/discord" release-bin-entitlements: @@ -1977,7 +1977,7 @@ integration-test-dev: # to run integration tests USE_EXISTING_PROCESS=true TEST_SERVER_URL=http://localhost:3000 node test/scripts/browser.js copy-install: - cp src/cli/install.sh ../bun.sh/docs/install.html + cp src/cli/install.sh ../bun.com/docs/install.html copy-to-bun-release-dir: copy-to-bun-release-dir-bin copy-to-bun-release-dir-dsym @@ -2019,28 +2019,28 @@ vendor-dev: assert-deps submodule npm-install-dev vendor-without-npm .PHONY: bun bun: @echo 'makefile is deprecated - use `cmake` / `bun run build`' - @echo 'See https://bun.sh/docs/project/contributing for more details' + @echo 'See https://bun.com/docs/project/contributing for more details' cpp: @echo 'makefile is deprecated - use `cmake` / `bun run build`' - @echo 'See https://bun.sh/docs/project/contributing for more details' + @echo 'See https://bun.com/docs/project/contributing for more details' zig: @echo 'makefile is deprecated - use `cmake` / `bun run build`' - @echo 'See https://bun.sh/docs/project/contributing for more details' + @echo 'See https://bun.com/docs/project/contributing for more details' dev: @echo 'makefile is deprecated - use `cmake` / `bun run build`' - @echo 'See https://bun.sh/docs/project/contributing for more details' + @echo 'See https://bun.com/docs/project/contributing for more details' setup: @echo 'makefile is deprecated - use `cmake` / `bun run build`' - @echo 'See https://bun.sh/docs/project/contributing for more details' + @echo 'See https://bun.com/docs/project/contributing for more details' bindings: @echo 'makefile is deprecated - use `cmake` / `bun run build`' - @echo 'See https://bun.sh/docs/project/contributing for more details' + @echo 'See https://bun.com/docs/project/contributing for more details' help: @echo 'makefile is deprecated - use `cmake` / `bun run build`' - @echo 'See https://bun.sh/docs/project/contributing for more details' + @echo 'See https://bun.com/docs/project/contributing for more details' diff --git a/README.md b/README.md index d9d3f8e596..61733ac8e8 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,16 @@

- Logo + Logo

Bun

- + stars Bun speed

- Documentation + Documentation   •   Discord   •   @@ -20,7 +20,7 @@
-### [Read the docs →](https://bun.sh/docs) +### [Read the docs →](https://bun.com/docs) ## What is Bun? @@ -47,14 +47,14 @@ Bun supports Linux (x64 & arm64), macOS (x64 & Apple Silicon) and Windows (x64). > **Linux users** — Kernel version 5.6 or higher is strongly recommended, but the minimum is 5.1. -> **x64 users** — if you see "illegal instruction" or similar errors, check our [CPU requirements](https://bun.sh/docs/installation#cpu-requirements-and-baseline-builds) +> **x64 users** — if you see "illegal instruction" or similar errors, check our [CPU requirements](https://bun.com/docs/installation#cpu-requirements-and-baseline-builds) ```sh # with install script (recommended) -curl -fsSL https://bun.sh/install | bash +curl -fsSL https://bun.com/install | bash # on windows -powershell -c "irm bun.sh/install.ps1 | iex" +powershell -c "irm bun.com/install.ps1 | iex" # with npm npm install -g bun @@ -87,351 +87,329 @@ bun upgrade --canary ## Quick links - Intro - - - [What is Bun?](https://bun.sh/docs/index) - - [Installation](https://bun.sh/docs/installation) - - [Quickstart](https://bun.sh/docs/quickstart) - - [TypeScript](https://bun.sh/docs/typescript) + - [What is Bun?](https://bun.com/docs/index) + - [Installation](https://bun.com/docs/installation) + - [Quickstart](https://bun.com/docs/quickstart) + - [TypeScript](https://bun.com/docs/typescript) - Templating - - - [`bun init`](https://bun.sh/docs/cli/init) - - [`bun create`](https://bun.sh/docs/cli/bun-create) + - [`bun init`](https://bun.com/docs/cli/init) + - [`bun create`](https://bun.com/docs/cli/bun-create) - CLI - - - [`bun upgrade`](https://bun.sh/docs/cli/bun-upgrade) + - [`bun upgrade`](https://bun.com/docs/cli/bun-upgrade) - Runtime - - - [`bun run`](https://bun.sh/docs/cli/run) - - [File types (Loaders)](https://bun.sh/docs/runtime/loaders) - - [TypeScript](https://bun.sh/docs/runtime/typescript) - - [JSX](https://bun.sh/docs/runtime/jsx) - - [Environment variables](https://bun.sh/docs/runtime/env) - - [Bun APIs](https://bun.sh/docs/runtime/bun-apis) - - [Web APIs](https://bun.sh/docs/runtime/web-apis) - - [Node.js compatibility](https://bun.sh/docs/runtime/nodejs-apis) - - [Single-file executable](https://bun.sh/docs/bundler/executables) - - [Plugins](https://bun.sh/docs/runtime/plugins) - - [Watch mode / Hot Reloading](https://bun.sh/docs/runtime/hot) - - [Module resolution](https://bun.sh/docs/runtime/modules) - - [Auto-install](https://bun.sh/docs/runtime/autoimport) - - [bunfig.toml](https://bun.sh/docs/runtime/bunfig) - - [Debugger](https://bun.sh/docs/runtime/debugger) - - [$ Shell](https://bun.sh/docs/runtime/shell) + - [`bun run`](https://bun.com/docs/cli/run) + - [File types (Loaders)](https://bun.com/docs/runtime/loaders) + - [TypeScript](https://bun.com/docs/runtime/typescript) + - [JSX](https://bun.com/docs/runtime/jsx) + - [Environment variables](https://bun.com/docs/runtime/env) + - [Bun APIs](https://bun.com/docs/runtime/bun-apis) + - [Web APIs](https://bun.com/docs/runtime/web-apis) + - [Node.js compatibility](https://bun.com/docs/runtime/nodejs-apis) + - [Single-file executable](https://bun.com/docs/bundler/executables) + - [Plugins](https://bun.com/docs/runtime/plugins) + - [Watch mode / Hot Reloading](https://bun.com/docs/runtime/hot) + - [Module resolution](https://bun.com/docs/runtime/modules) + - [Auto-install](https://bun.com/docs/runtime/autoimport) + - [bunfig.toml](https://bun.com/docs/runtime/bunfig) + - [Debugger](https://bun.com/docs/runtime/debugger) + - [$ Shell](https://bun.com/docs/runtime/shell) - Package manager - - - [`bun install`](https://bun.sh/docs/cli/install) - - [`bun add`](https://bun.sh/docs/cli/add) - - [`bun remove`](https://bun.sh/docs/cli/remove) - - [`bun update`](https://bun.sh/docs/cli/update) - - [`bun link`](https://bun.sh/docs/cli/link) - - [`bun unlink`](https://bun.sh/docs/cli/unlink) - - [`bun pm`](https://bun.sh/docs/cli/pm) - - [`bun outdated`](https://bun.sh/docs/cli/outdated) - - [`bun publish`](https://bun.sh/docs/cli/publish) - - [`bun patch`](https://bun.sh/docs/install/patch) - - [`bun patch-commit`](https://bun.sh/docs/cli/patch-commit) - - [Global cache](https://bun.sh/docs/install/cache) - - [Workspaces](https://bun.sh/docs/install/workspaces) - - [Lifecycle scripts](https://bun.sh/docs/install/lifecycle) - - [Filter](https://bun.sh/docs/cli/filter) - - [Lockfile](https://bun.sh/docs/install/lockfile) - - [Scopes and registries](https://bun.sh/docs/install/registries) - - [Overrides and resolutions](https://bun.sh/docs/install/overrides) - - [`.npmrc`](https://bun.sh/docs/install/npmrc) + - [`bun install`](https://bun.com/docs/cli/install) + - [`bun add`](https://bun.com/docs/cli/add) + - [`bun remove`](https://bun.com/docs/cli/remove) + - [`bun update`](https://bun.com/docs/cli/update) + - [`bun link`](https://bun.com/docs/cli/link) + - [`bun unlink`](https://bun.com/docs/cli/unlink) + - [`bun pm`](https://bun.com/docs/cli/pm) + - [`bun outdated`](https://bun.com/docs/cli/outdated) + - [`bun publish`](https://bun.com/docs/cli/publish) + - [`bun patch`](https://bun.com/docs/install/patch) + - [`bun patch-commit`](https://bun.com/docs/cli/patch-commit) + - [Global cache](https://bun.com/docs/install/cache) + - [Workspaces](https://bun.com/docs/install/workspaces) + - [Lifecycle scripts](https://bun.com/docs/install/lifecycle) + - [Filter](https://bun.com/docs/cli/filter) + - [Lockfile](https://bun.com/docs/install/lockfile) + - [Scopes and registries](https://bun.com/docs/install/registries) + - [Overrides and resolutions](https://bun.com/docs/install/overrides) + - [`.npmrc`](https://bun.com/docs/install/npmrc) - Bundler - - - [`Bun.build`](https://bun.sh/docs/bundler) - - [Loaders](https://bun.sh/docs/bundler/loaders) - - [Plugins](https://bun.sh/docs/bundler/plugins) - - [Macros](https://bun.sh/docs/bundler/macros) - - [vs esbuild](https://bun.sh/docs/bundler/vs-esbuild) - - [Single-file executable](https://bun.sh/docs/bundler/executables) - - [CSS](https://bun.sh/docs/bundler/css) - - [HTML](https://bun.sh/docs/bundler/html) - - [Hot Module Replacement (HMR)](https://bun.sh/docs/bundler/hmr) - - [Full-stack with HTML imports](https://bun.sh/docs/bundler/fullstack) + - [`Bun.build`](https://bun.com/docs/bundler) + - [Loaders](https://bun.com/docs/bundler/loaders) + - [Plugins](https://bun.com/docs/bundler/plugins) + - [Macros](https://bun.com/docs/bundler/macros) + - [vs esbuild](https://bun.com/docs/bundler/vs-esbuild) + - [Single-file executable](https://bun.com/docs/bundler/executables) + - [CSS](https://bun.com/docs/bundler/css) + - [HTML](https://bun.com/docs/bundler/html) + - [Hot Module Replacement (HMR)](https://bun.com/docs/bundler/hmr) + - [Full-stack with HTML imports](https://bun.com/docs/bundler/fullstack) - Test runner - - - [`bun test`](https://bun.sh/docs/cli/test) - - [Writing tests](https://bun.sh/docs/test/writing) - - [Watch mode](https://bun.sh/docs/test/hot) - - [Lifecycle hooks](https://bun.sh/docs/test/lifecycle) - - [Mocks](https://bun.sh/docs/test/mocks) - - [Snapshots](https://bun.sh/docs/test/snapshots) - - [Dates and times](https://bun.sh/docs/test/time) - - [DOM testing](https://bun.sh/docs/test/dom) - - [Code coverage](https://bun.sh/docs/test/coverage) - - [Configuration](https://bun.sh/docs/test/configuration) - - [Discovery](https://bun.sh/docs/test/discovery) - - [Reporters](https://bun.sh/docs/test/reporters) - - [Runtime Behavior](https://bun.sh/docs/test/runtime-behavior) + - [`bun test`](https://bun.com/docs/cli/test) + - [Writing tests](https://bun.com/docs/test/writing) + - [Watch mode](https://bun.com/docs/test/hot) + - [Lifecycle hooks](https://bun.com/docs/test/lifecycle) + - [Mocks](https://bun.com/docs/test/mocks) + - [Snapshots](https://bun.com/docs/test/snapshots) + - [Dates and times](https://bun.com/docs/test/time) + - [DOM testing](https://bun.com/docs/test/dom) + - [Code coverage](https://bun.com/docs/test/coverage) + - [Configuration](https://bun.com/docs/test/configuration) + - [Discovery](https://bun.com/docs/test/discovery) + - [Reporters](https://bun.com/docs/test/reporters) + - [Runtime Behavior](https://bun.com/docs/test/runtime-behavior) - Package runner - - - [`bunx`](https://bun.sh/docs/cli/bunx) + - [`bunx`](https://bun.com/docs/cli/bunx) - API - - - [HTTP server (`Bun.serve`)](https://bun.sh/docs/api/http) - - [WebSockets](https://bun.sh/docs/api/websockets) - - [Workers](https://bun.sh/docs/api/workers) - - [Binary data](https://bun.sh/docs/api/binary-data) - - [Streams](https://bun.sh/docs/api/streams) - - [File I/O (`Bun.file`)](https://bun.sh/docs/api/file-io) - - [import.meta](https://bun.sh/docs/api/import-meta) - - [SQLite (`bun:sqlite`)](https://bun.sh/docs/api/sqlite) - - [PostgreSQL (`Bun.sql`)](https://bun.sh/docs/api/sql) - - [Redis (`Bun.redis`)](https://bun.sh/docs/api/redis) - - [S3 Client (`Bun.s3`)](https://bun.sh/docs/api/s3) - - [FileSystemRouter](https://bun.sh/docs/api/file-system-router) - - [TCP sockets](https://bun.sh/docs/api/tcp) - - [UDP sockets](https://bun.sh/docs/api/udp) - - [Globals](https://bun.sh/docs/api/globals) - - [$ Shell](https://bun.sh/docs/runtime/shell) - - [Child processes (spawn)](https://bun.sh/docs/api/spawn) - - [Transpiler (`Bun.Transpiler`)](https://bun.sh/docs/api/transpiler) - - [Hashing](https://bun.sh/docs/api/hashing) - - [Colors (`Bun.color`)](https://bun.sh/docs/api/color) - - [Console](https://bun.sh/docs/api/console) - - [FFI (`bun:ffi`)](https://bun.sh/docs/api/ffi) - - [C Compiler (`bun:ffi` cc)](https://bun.sh/docs/api/cc) - - [HTMLRewriter](https://bun.sh/docs/api/html-rewriter) - - [Testing (`bun:test`)](https://bun.sh/docs/api/test) - - [Cookies (`Bun.Cookie`)](https://bun.sh/docs/api/cookie) - - [Utils](https://bun.sh/docs/api/utils) - - [Node-API](https://bun.sh/docs/api/node-api) - - [Glob (`Bun.Glob`)](https://bun.sh/docs/api/glob) - - [Semver (`Bun.semver`)](https://bun.sh/docs/api/semver) - - [DNS](https://bun.sh/docs/api/dns) - - [fetch API extensions](https://bun.sh/docs/api/fetch) + - [HTTP server (`Bun.serve`)](https://bun.com/docs/api/http) + - [WebSockets](https://bun.com/docs/api/websockets) + - [Workers](https://bun.com/docs/api/workers) + - [Binary data](https://bun.com/docs/api/binary-data) + - [Streams](https://bun.com/docs/api/streams) + - [File I/O (`Bun.file`)](https://bun.com/docs/api/file-io) + - [import.meta](https://bun.com/docs/api/import-meta) + - [SQLite (`bun:sqlite`)](https://bun.com/docs/api/sqlite) + - [PostgreSQL (`Bun.sql`)](https://bun.com/docs/api/sql) + - [Redis (`Bun.redis`)](https://bun.com/docs/api/redis) + - [S3 Client (`Bun.s3`)](https://bun.com/docs/api/s3) + - [FileSystemRouter](https://bun.com/docs/api/file-system-router) + - [TCP sockets](https://bun.com/docs/api/tcp) + - [UDP sockets](https://bun.com/docs/api/udp) + - [Globals](https://bun.com/docs/api/globals) + - [$ Shell](https://bun.com/docs/runtime/shell) + - [Child processes (spawn)](https://bun.com/docs/api/spawn) + - [Transpiler (`Bun.Transpiler`)](https://bun.com/docs/api/transpiler) + - [Hashing](https://bun.com/docs/api/hashing) + - [Colors (`Bun.color`)](https://bun.com/docs/api/color) + - [Console](https://bun.com/docs/api/console) + - [FFI (`bun:ffi`)](https://bun.com/docs/api/ffi) + - [C Compiler (`bun:ffi` cc)](https://bun.com/docs/api/cc) + - [HTMLRewriter](https://bun.com/docs/api/html-rewriter) + - [Testing (`bun:test`)](https://bun.com/docs/api/test) + - [Cookies (`Bun.Cookie`)](https://bun.com/docs/api/cookie) + - [Utils](https://bun.com/docs/api/utils) + - [Node-API](https://bun.com/docs/api/node-api) + - [Glob (`Bun.Glob`)](https://bun.com/docs/api/glob) + - [Semver (`Bun.semver`)](https://bun.com/docs/api/semver) + - [DNS](https://bun.com/docs/api/dns) + - [fetch API extensions](https://bun.com/docs/api/fetch) ## Guides - Binary - - - [Convert a Blob to a string](https://bun.sh/guides/binary/blob-to-string) - - [Convert a Buffer to a blob](https://bun.sh/guides/binary/buffer-to-blob) - - [Convert a Blob to a DataView](https://bun.sh/guides/binary/blob-to-dataview) - - [Convert a Buffer to a string](https://bun.sh/guides/binary/buffer-to-string) - - [Convert a Blob to a ReadableStream](https://bun.sh/guides/binary/blob-to-stream) - - [Convert a Blob to a Uint8Array](https://bun.sh/guides/binary/blob-to-typedarray) - - [Convert a DataView to a string](https://bun.sh/guides/binary/dataview-to-string) - - [Convert a Uint8Array to a Blob](https://bun.sh/guides/binary/typedarray-to-blob) - - [Convert a Blob to an ArrayBuffer](https://bun.sh/guides/binary/blob-to-arraybuffer) - - [Convert an ArrayBuffer to a Blob](https://bun.sh/guides/binary/arraybuffer-to-blob) - - [Convert a Buffer to a Uint8Array](https://bun.sh/guides/binary/buffer-to-typedarray) - - [Convert a Uint8Array to a Buffer](https://bun.sh/guides/binary/typedarray-to-buffer) - - [Convert a Uint8Array to a string](https://bun.sh/guides/binary/typedarray-to-string) - - [Convert a Buffer to an ArrayBuffer](https://bun.sh/guides/binary/buffer-to-arraybuffer) - - [Convert an ArrayBuffer to a Buffer](https://bun.sh/guides/binary/arraybuffer-to-buffer) - - [Convert an ArrayBuffer to a string](https://bun.sh/guides/binary/arraybuffer-to-string) - - [Convert a Uint8Array to a DataView](https://bun.sh/guides/binary/typedarray-to-dataview) - - [Convert a Buffer to a ReadableStream](https://bun.sh/guides/binary/buffer-to-readablestream) - - [Convert a Uint8Array to an ArrayBuffer](https://bun.sh/guides/binary/typedarray-to-arraybuffer) - - [Convert an ArrayBuffer to a Uint8Array](https://bun.sh/guides/binary/arraybuffer-to-typedarray) - - [Convert an ArrayBuffer to an array of numbers](https://bun.sh/guides/binary/arraybuffer-to-array) - - [Convert a Uint8Array to a ReadableStream](https://bun.sh/guides/binary/typedarray-to-readablestream) + - [Convert a Blob to a string](https://bun.com/guides/binary/blob-to-string) + - [Convert a Buffer to a blob](https://bun.com/guides/binary/buffer-to-blob) + - [Convert a Blob to a DataView](https://bun.com/guides/binary/blob-to-dataview) + - [Convert a Buffer to a string](https://bun.com/guides/binary/buffer-to-string) + - [Convert a Blob to a ReadableStream](https://bun.com/guides/binary/blob-to-stream) + - [Convert a Blob to a Uint8Array](https://bun.com/guides/binary/blob-to-typedarray) + - [Convert a DataView to a string](https://bun.com/guides/binary/dataview-to-string) + - [Convert a Uint8Array to a Blob](https://bun.com/guides/binary/typedarray-to-blob) + - [Convert a Blob to an ArrayBuffer](https://bun.com/guides/binary/blob-to-arraybuffer) + - [Convert an ArrayBuffer to a Blob](https://bun.com/guides/binary/arraybuffer-to-blob) + - [Convert a Buffer to a Uint8Array](https://bun.com/guides/binary/buffer-to-typedarray) + - [Convert a Uint8Array to a Buffer](https://bun.com/guides/binary/typedarray-to-buffer) + - [Convert a Uint8Array to a string](https://bun.com/guides/binary/typedarray-to-string) + - [Convert a Buffer to an ArrayBuffer](https://bun.com/guides/binary/buffer-to-arraybuffer) + - [Convert an ArrayBuffer to a Buffer](https://bun.com/guides/binary/arraybuffer-to-buffer) + - [Convert an ArrayBuffer to a string](https://bun.com/guides/binary/arraybuffer-to-string) + - [Convert a Uint8Array to a DataView](https://bun.com/guides/binary/typedarray-to-dataview) + - [Convert a Buffer to a ReadableStream](https://bun.com/guides/binary/buffer-to-readablestream) + - [Convert a Uint8Array to an ArrayBuffer](https://bun.com/guides/binary/typedarray-to-arraybuffer) + - [Convert an ArrayBuffer to a Uint8Array](https://bun.com/guides/binary/arraybuffer-to-typedarray) + - [Convert an ArrayBuffer to an array of numbers](https://bun.com/guides/binary/arraybuffer-to-array) + - [Convert a Uint8Array to a ReadableStream](https://bun.com/guides/binary/typedarray-to-readablestream) - Ecosystem - - - [Use React and JSX](https://bun.sh/guides/ecosystem/react) - - [Use EdgeDB with Bun](https://bun.sh/guides/ecosystem/edgedb) - - [Use Prisma with Bun](https://bun.sh/guides/ecosystem/prisma) - - [Add Sentry to a Bun app](https://bun.sh/guides/ecosystem/sentry) - - [Create a Discord bot](https://bun.sh/guides/ecosystem/discordjs) - - [Run Bun as a daemon with PM2](https://bun.sh/guides/ecosystem/pm2) - - [Use Drizzle ORM with Bun](https://bun.sh/guides/ecosystem/drizzle) - - [Build an app with Nuxt and Bun](https://bun.sh/guides/ecosystem/nuxt) - - [Build an app with Qwik and Bun](https://bun.sh/guides/ecosystem/qwik) - - [Build an app with Astro and Bun](https://bun.sh/guides/ecosystem/astro) - - [Build an app with Remix and Bun](https://bun.sh/guides/ecosystem/remix) - - [Build a frontend using Vite and Bun](https://bun.sh/guides/ecosystem/vite) - - [Build an app with Next.js and Bun](https://bun.sh/guides/ecosystem/nextjs) - - [Run Bun as a daemon with systemd](https://bun.sh/guides/ecosystem/systemd) - - [Deploy a Bun application on Render](https://bun.sh/guides/ecosystem/render) - - [Build an HTTP server using Hono and Bun](https://bun.sh/guides/ecosystem/hono) - - [Build an app with SvelteKit and Bun](https://bun.sh/guides/ecosystem/sveltekit) - - [Build an app with SolidStart and Bun](https://bun.sh/guides/ecosystem/solidstart) - - [Build an HTTP server using Elysia and Bun](https://bun.sh/guides/ecosystem/elysia) - - [Build an HTTP server using StricJS and Bun](https://bun.sh/guides/ecosystem/stric) - - [Containerize a Bun application with Docker](https://bun.sh/guides/ecosystem/docker) - - [Build an HTTP server using Express and Bun](https://bun.sh/guides/ecosystem/express) - - [Use Neon Postgres through Drizzle ORM](https://bun.sh/guides/ecosystem/neon-drizzle) - - [Server-side render (SSR) a React component](https://bun.sh/guides/ecosystem/ssr-react) - - [Read and write data to MongoDB using Mongoose and Bun](https://bun.sh/guides/ecosystem/mongoose) - - [Use Neon's Serverless Postgres with Bun](https://bun.sh/guides/ecosystem/neon-serverless-postgres) + - [Use React and JSX](https://bun.com/guides/ecosystem/react) + - [Use EdgeDB with Bun](https://bun.com/guides/ecosystem/edgedb) + - [Use Prisma with Bun](https://bun.com/guides/ecosystem/prisma) + - [Add Sentry to a Bun app](https://bun.com/guides/ecosystem/sentry) + - [Create a Discord bot](https://bun.com/guides/ecosystem/discordjs) + - [Run Bun as a daemon with PM2](https://bun.com/guides/ecosystem/pm2) + - [Use Drizzle ORM with Bun](https://bun.com/guides/ecosystem/drizzle) + - [Build an app with Nuxt and Bun](https://bun.com/guides/ecosystem/nuxt) + - [Build an app with Qwik and Bun](https://bun.com/guides/ecosystem/qwik) + - [Build an app with Astro and Bun](https://bun.com/guides/ecosystem/astro) + - [Build an app with Remix and Bun](https://bun.com/guides/ecosystem/remix) + - [Build a frontend using Vite and Bun](https://bun.com/guides/ecosystem/vite) + - [Build an app with Next.js and Bun](https://bun.com/guides/ecosystem/nextjs) + - [Run Bun as a daemon with systemd](https://bun.com/guides/ecosystem/systemd) + - [Deploy a Bun application on Render](https://bun.com/guides/ecosystem/render) + - [Build an HTTP server using Hono and Bun](https://bun.com/guides/ecosystem/hono) + - [Build an app with SvelteKit and Bun](https://bun.com/guides/ecosystem/sveltekit) + - [Build an app with SolidStart and Bun](https://bun.com/guides/ecosystem/solidstart) + - [Build an HTTP server using Elysia and Bun](https://bun.com/guides/ecosystem/elysia) + - [Build an HTTP server using StricJS and Bun](https://bun.com/guides/ecosystem/stric) + - [Containerize a Bun application with Docker](https://bun.com/guides/ecosystem/docker) + - [Build an HTTP server using Express and Bun](https://bun.com/guides/ecosystem/express) + - [Use Neon Postgres through Drizzle ORM](https://bun.com/guides/ecosystem/neon-drizzle) + - [Server-side render (SSR) a React component](https://bun.com/guides/ecosystem/ssr-react) + - [Read and write data to MongoDB using Mongoose and Bun](https://bun.com/guides/ecosystem/mongoose) + - [Use Neon's Serverless Postgres with Bun](https://bun.com/guides/ecosystem/neon-serverless-postgres) - HTMLRewriter - - - [Extract links from a webpage using HTMLRewriter](https://bun.sh/guides/html-rewriter/extract-links) - - [Extract social share images and Open Graph tags](https://bun.sh/guides/html-rewriter/extract-social-meta) + - [Extract links from a webpage using HTMLRewriter](https://bun.com/guides/html-rewriter/extract-links) + - [Extract social share images and Open Graph tags](https://bun.com/guides/html-rewriter/extract-social-meta) - HTTP - - - [Hot reload an HTTP server](https://bun.sh/guides/http/hot) - - [Common HTTP server usage](https://bun.sh/guides/http/server) - - [Write a simple HTTP server](https://bun.sh/guides/http/simple) - - [Configure TLS on an HTTP server](https://bun.sh/guides/http/tls) - - [Send an HTTP request using fetch](https://bun.sh/guides/http/fetch) - - [Proxy HTTP requests using fetch()](https://bun.sh/guides/http/proxy) - - [Start a cluster of HTTP servers](https://bun.sh/guides/http/cluster) - - [Stream a file as an HTTP Response](https://bun.sh/guides/http/stream-file) - - [fetch with unix domain sockets in Bun](https://bun.sh/guides/http/fetch-unix) - - [Upload files via HTTP using FormData](https://bun.sh/guides/http/file-uploads) - - [Streaming HTTP Server with Async Iterators](https://bun.sh/guides/http/stream-iterator) - - [Streaming HTTP Server with Node.js Streams](https://bun.sh/guides/http/stream-node-streams-in-bun) + - [Hot reload an HTTP server](https://bun.com/guides/http/hot) + - [Common HTTP server usage](https://bun.com/guides/http/server) + - [Write a simple HTTP server](https://bun.com/guides/http/simple) + - [Configure TLS on an HTTP server](https://bun.com/guides/http/tls) + - [Send an HTTP request using fetch](https://bun.com/guides/http/fetch) + - [Proxy HTTP requests using fetch()](https://bun.com/guides/http/proxy) + - [Start a cluster of HTTP servers](https://bun.com/guides/http/cluster) + - [Stream a file as an HTTP Response](https://bun.com/guides/http/stream-file) + - [fetch with unix domain sockets in Bun](https://bun.com/guides/http/fetch-unix) + - [Upload files via HTTP using FormData](https://bun.com/guides/http/file-uploads) + - [Streaming HTTP Server with Async Iterators](https://bun.com/guides/http/stream-iterator) + - [Streaming HTTP Server with Node.js Streams](https://bun.com/guides/http/stream-node-streams-in-bun) - Install - - - [Add a dependency](https://bun.sh/guides/install/add) - - [Add a Git dependency](https://bun.sh/guides/install/add-git) - - [Add a peer dependency](https://bun.sh/guides/install/add-peer) - - [Add a trusted dependency](https://bun.sh/guides/install/trusted) - - [Add a development dependency](https://bun.sh/guides/install/add-dev) - - [Add a tarball dependency](https://bun.sh/guides/install/add-tarball) - - [Add an optional dependency](https://bun.sh/guides/install/add-optional) - - [Generate a yarn-compatible lockfile](https://bun.sh/guides/install/yarnlock) - - [Configuring a monorepo using workspaces](https://bun.sh/guides/install/workspaces) - - [Install a package under a different name](https://bun.sh/guides/install/npm-alias) - - [Install dependencies with Bun in GitHub Actions](https://bun.sh/guides/install/cicd) - - [Using bun install with Artifactory](https://bun.sh/guides/install/jfrog-artifactory) - - [Configure git to diff Bun's lockb lockfile](https://bun.sh/guides/install/git-diff-bun-lockfile) - - [Override the default npm registry for bun install](https://bun.sh/guides/install/custom-registry) - - [Using bun install with an Azure Artifacts npm registry](https://bun.sh/guides/install/azure-artifacts) - - [Migrate from npm install to bun install](https://bun.sh/guides/install/from-npm-install-to-bun-install) - - [Configure a private registry for an organization scope with bun install](https://bun.sh/guides/install/registry-scope) + - [Add a dependency](https://bun.com/guides/install/add) + - [Add a Git dependency](https://bun.com/guides/install/add-git) + - [Add a peer dependency](https://bun.com/guides/install/add-peer) + - [Add a trusted dependency](https://bun.com/guides/install/trusted) + - [Add a development dependency](https://bun.com/guides/install/add-dev) + - [Add a tarball dependency](https://bun.com/guides/install/add-tarball) + - [Add an optional dependency](https://bun.com/guides/install/add-optional) + - [Generate a yarn-compatible lockfile](https://bun.com/guides/install/yarnlock) + - [Configuring a monorepo using workspaces](https://bun.com/guides/install/workspaces) + - [Install a package under a different name](https://bun.com/guides/install/npm-alias) + - [Install dependencies with Bun in GitHub Actions](https://bun.com/guides/install/cicd) + - [Using bun install with Artifactory](https://bun.com/guides/install/jfrog-artifactory) + - [Configure git to diff Bun's lockb lockfile](https://bun.com/guides/install/git-diff-bun-lockfile) + - [Override the default npm registry for bun install](https://bun.com/guides/install/custom-registry) + - [Using bun install with an Azure Artifacts npm registry](https://bun.com/guides/install/azure-artifacts) + - [Migrate from npm install to bun install](https://bun.com/guides/install/from-npm-install-to-bun-install) + - [Configure a private registry for an organization scope with bun install](https://bun.com/guides/install/registry-scope) - Process - - - [Read from stdin](https://bun.sh/guides/process/stdin) - - [Listen for CTRL+C](https://bun.sh/guides/process/ctrl-c) - - [Spawn a child process](https://bun.sh/guides/process/spawn) - - [Listen to OS signals](https://bun.sh/guides/process/os-signals) - - [Parse command-line arguments](https://bun.sh/guides/process/argv) - - [Read stderr from a child process](https://bun.sh/guides/process/spawn-stderr) - - [Read stdout from a child process](https://bun.sh/guides/process/spawn-stdout) - - [Get the process uptime in nanoseconds](https://bun.sh/guides/process/nanoseconds) - - [Spawn a child process and communicate using IPC](https://bun.sh/guides/process/ipc) + - [Read from stdin](https://bun.com/guides/process/stdin) + - [Listen for CTRL+C](https://bun.com/guides/process/ctrl-c) + - [Spawn a child process](https://bun.com/guides/process/spawn) + - [Listen to OS signals](https://bun.com/guides/process/os-signals) + - [Parse command-line arguments](https://bun.com/guides/process/argv) + - [Read stderr from a child process](https://bun.com/guides/process/spawn-stderr) + - [Read stdout from a child process](https://bun.com/guides/process/spawn-stdout) + - [Get the process uptime in nanoseconds](https://bun.com/guides/process/nanoseconds) + - [Spawn a child process and communicate using IPC](https://bun.com/guides/process/ipc) - Read file - - - [Read a JSON file](https://bun.sh/guides/read-file/json) - - [Check if a file exists](https://bun.sh/guides/read-file/exists) - - [Read a file as a string](https://bun.sh/guides/read-file/string) - - [Read a file to a Buffer](https://bun.sh/guides/read-file/buffer) - - [Get the MIME type of a file](https://bun.sh/guides/read-file/mime) - - [Watch a directory for changes](https://bun.sh/guides/read-file/watch) - - [Read a file as a ReadableStream](https://bun.sh/guides/read-file/stream) - - [Read a file to a Uint8Array](https://bun.sh/guides/read-file/uint8array) - - [Read a file to an ArrayBuffer](https://bun.sh/guides/read-file/arraybuffer) + - [Read a JSON file](https://bun.com/guides/read-file/json) + - [Check if a file exists](https://bun.com/guides/read-file/exists) + - [Read a file as a string](https://bun.com/guides/read-file/string) + - [Read a file to a Buffer](https://bun.com/guides/read-file/buffer) + - [Get the MIME type of a file](https://bun.com/guides/read-file/mime) + - [Watch a directory for changes](https://bun.com/guides/read-file/watch) + - [Read a file as a ReadableStream](https://bun.com/guides/read-file/stream) + - [Read a file to a Uint8Array](https://bun.com/guides/read-file/uint8array) + - [Read a file to an ArrayBuffer](https://bun.com/guides/read-file/arraybuffer) - Runtime - - - [Delete files](https://bun.sh/guides/runtime/delete-file) - - [Run a Shell Command](https://bun.sh/guides/runtime/shell) - - [Import a JSON file](https://bun.sh/guides/runtime/import-json) - - [Import a TOML file](https://bun.sh/guides/runtime/import-toml) - - [Set a time zone in Bun](https://bun.sh/guides/runtime/timezone) - - [Set environment variables](https://bun.sh/guides/runtime/set-env) - - [Re-map import paths](https://bun.sh/guides/runtime/tsconfig-paths) - - [Delete directories](https://bun.sh/guides/runtime/delete-directory) - - [Read environment variables](https://bun.sh/guides/runtime/read-env) - - [Import a HTML file as text](https://bun.sh/guides/runtime/import-html) - - [Install and run Bun in GitHub Actions](https://bun.sh/guides/runtime/cicd) - - [Debugging Bun with the web debugger](https://bun.sh/guides/runtime/web-debugger) - - [Install TypeScript declarations for Bun](https://bun.sh/guides/runtime/typescript) - - [Debugging Bun with the VS Code extension](https://bun.sh/guides/runtime/vscode-debugger) - - [Inspect memory usage using V8 heap snapshots](https://bun.sh/guides/runtime/heap-snapshot) - - [Define and replace static globals & constants](https://bun.sh/guides/runtime/define-constant) - - [Codesign a single-file JavaScript executable on macOS](https://bun.sh/guides/runtime/codesign-macos-executable) + - [Delete files](https://bun.com/guides/runtime/delete-file) + - [Run a Shell Command](https://bun.com/guides/runtime/shell) + - [Import a JSON file](https://bun.com/guides/runtime/import-json) + - [Import a TOML file](https://bun.com/guides/runtime/import-toml) + - [Set a time zone in Bun](https://bun.com/guides/runtime/timezone) + - [Set environment variables](https://bun.com/guides/runtime/set-env) + - [Re-map import paths](https://bun.com/guides/runtime/tsconfig-paths) + - [Delete directories](https://bun.com/guides/runtime/delete-directory) + - [Read environment variables](https://bun.com/guides/runtime/read-env) + - [Import a HTML file as text](https://bun.com/guides/runtime/import-html) + - [Install and run Bun in GitHub Actions](https://bun.com/guides/runtime/cicd) + - [Debugging Bun with the web debugger](https://bun.com/guides/runtime/web-debugger) + - [Install TypeScript declarations for Bun](https://bun.com/guides/runtime/typescript) + - [Debugging Bun with the VS Code extension](https://bun.com/guides/runtime/vscode-debugger) + - [Inspect memory usage using V8 heap snapshots](https://bun.com/guides/runtime/heap-snapshot) + - [Define and replace static globals & constants](https://bun.com/guides/runtime/define-constant) + - [Codesign a single-file JavaScript executable on macOS](https://bun.com/guides/runtime/codesign-macos-executable) - Streams - - - [Convert a ReadableStream to JSON](https://bun.sh/guides/streams/to-json) - - [Convert a ReadableStream to a Blob](https://bun.sh/guides/streams/to-blob) - - [Convert a ReadableStream to a Buffer](https://bun.sh/guides/streams/to-buffer) - - [Convert a ReadableStream to a string](https://bun.sh/guides/streams/to-string) - - [Convert a ReadableStream to a Uint8Array](https://bun.sh/guides/streams/to-typedarray) - - [Convert a ReadableStream to an array of chunks](https://bun.sh/guides/streams/to-array) - - [Convert a Node.js Readable to JSON](https://bun.sh/guides/streams/node-readable-to-json) - - [Convert a ReadableStream to an ArrayBuffer](https://bun.sh/guides/streams/to-arraybuffer) - - [Convert a Node.js Readable to a Blob](https://bun.sh/guides/streams/node-readable-to-blob) - - [Convert a Node.js Readable to a string](https://bun.sh/guides/streams/node-readable-to-string) - - [Convert a Node.js Readable to an Uint8Array](https://bun.sh/guides/streams/node-readable-to-uint8array) - - [Convert a Node.js Readable to an ArrayBuffer](https://bun.sh/guides/streams/node-readable-to-arraybuffer) + - [Convert a ReadableStream to JSON](https://bun.com/guides/streams/to-json) + - [Convert a ReadableStream to a Blob](https://bun.com/guides/streams/to-blob) + - [Convert a ReadableStream to a Buffer](https://bun.com/guides/streams/to-buffer) + - [Convert a ReadableStream to a string](https://bun.com/guides/streams/to-string) + - [Convert a ReadableStream to a Uint8Array](https://bun.com/guides/streams/to-typedarray) + - [Convert a ReadableStream to an array of chunks](https://bun.com/guides/streams/to-array) + - [Convert a Node.js Readable to JSON](https://bun.com/guides/streams/node-readable-to-json) + - [Convert a ReadableStream to an ArrayBuffer](https://bun.com/guides/streams/to-arraybuffer) + - [Convert a Node.js Readable to a Blob](https://bun.com/guides/streams/node-readable-to-blob) + - [Convert a Node.js Readable to a string](https://bun.com/guides/streams/node-readable-to-string) + - [Convert a Node.js Readable to an Uint8Array](https://bun.com/guides/streams/node-readable-to-uint8array) + - [Convert a Node.js Readable to an ArrayBuffer](https://bun.com/guides/streams/node-readable-to-arraybuffer) - Test - - - [Spy on methods in `bun test`](https://bun.sh/guides/test/spy-on) - - [Bail early with the Bun test runner](https://bun.sh/guides/test/bail) - - [Mock functions in `bun test`](https://bun.sh/guides/test/mock-functions) - - [Run tests in watch mode with Bun](https://bun.sh/guides/test/watch-mode) - - [Use snapshot testing in `bun test`](https://bun.sh/guides/test/snapshot) - - [Skip tests with the Bun test runner](https://bun.sh/guides/test/skip-tests) - - [Using Testing Library with Bun](https://bun.sh/guides/test/testing-library) - - [Update snapshots in `bun test`](https://bun.sh/guides/test/update-snapshots) - - [Run your tests with the Bun test runner](https://bun.sh/guides/test/run-tests) - - [Set the system time in Bun's test runner](https://bun.sh/guides/test/mock-clock) - - [Set a per-test timeout with the Bun test runner](https://bun.sh/guides/test/timeout) - - [Migrate from Jest to Bun's test runner](https://bun.sh/guides/test/migrate-from-jest) - - [Write browser DOM tests with Bun and happy-dom](https://bun.sh/guides/test/happy-dom) - - [Mark a test as a "todo" with the Bun test runner](https://bun.sh/guides/test/todo-tests) - - [Re-run tests multiple times with the Bun test runner](https://bun.sh/guides/test/rerun-each) - - [Generate code coverage reports with the Bun test runner](https://bun.sh/guides/test/coverage) - - [import, require, and test Svelte components with bun test](https://bun.sh/guides/test/svelte-test) - - [Set a code coverage threshold with the Bun test runner](https://bun.sh/guides/test/coverage-threshold) + - [Spy on methods in `bun test`](https://bun.com/guides/test/spy-on) + - [Bail early with the Bun test runner](https://bun.com/guides/test/bail) + - [Mock functions in `bun test`](https://bun.com/guides/test/mock-functions) + - [Run tests in watch mode with Bun](https://bun.com/guides/test/watch-mode) + - [Use snapshot testing in `bun test`](https://bun.com/guides/test/snapshot) + - [Skip tests with the Bun test runner](https://bun.com/guides/test/skip-tests) + - [Using Testing Library with Bun](https://bun.com/guides/test/testing-library) + - [Update snapshots in `bun test`](https://bun.com/guides/test/update-snapshots) + - [Run your tests with the Bun test runner](https://bun.com/guides/test/run-tests) + - [Set the system time in Bun's test runner](https://bun.com/guides/test/mock-clock) + - [Set a per-test timeout with the Bun test runner](https://bun.com/guides/test/timeout) + - [Migrate from Jest to Bun's test runner](https://bun.com/guides/test/migrate-from-jest) + - [Write browser DOM tests with Bun and happy-dom](https://bun.com/guides/test/happy-dom) + - [Mark a test as a "todo" with the Bun test runner](https://bun.com/guides/test/todo-tests) + - [Re-run tests multiple times with the Bun test runner](https://bun.com/guides/test/rerun-each) + - [Generate code coverage reports with the Bun test runner](https://bun.com/guides/test/coverage) + - [import, require, and test Svelte components with bun test](https://bun.com/guides/test/svelte-test) + - [Set a code coverage threshold with the Bun test runner](https://bun.com/guides/test/coverage-threshold) - Util - - - [Generate a UUID](https://bun.sh/guides/util/javascript-uuid) - - [Hash a password](https://bun.sh/guides/util/hash-a-password) - - [Escape an HTML string](https://bun.sh/guides/util/escape-html) - - [Get the current Bun version](https://bun.sh/guides/util/version) - - [Encode and decode base64 strings](https://bun.sh/guides/util/base64) - - [Compress and decompress data with gzip](https://bun.sh/guides/util/gzip) - - [Sleep for a fixed number of milliseconds](https://bun.sh/guides/util/sleep) - - [Detect when code is executed with Bun](https://bun.sh/guides/util/detect-bun) - - [Check if two objects are deeply equal](https://bun.sh/guides/util/deep-equals) - - [Compress and decompress data with DEFLATE](https://bun.sh/guides/util/deflate) - - [Get the absolute path to the current entrypoint](https://bun.sh/guides/util/main) - - [Get the directory of the current file](https://bun.sh/guides/util/import-meta-dir) - - [Check if the current file is the entrypoint](https://bun.sh/guides/util/entrypoint) - - [Get the file name of the current file](https://bun.sh/guides/util/import-meta-file) - - [Convert a file URL to an absolute path](https://bun.sh/guides/util/file-url-to-path) - - [Convert an absolute path to a file URL](https://bun.sh/guides/util/path-to-file-url) - - [Get the absolute path of the current file](https://bun.sh/guides/util/import-meta-path) - - [Get the path to an executable bin file](https://bun.sh/guides/util/which-path-to-executable-bin) + - [Generate a UUID](https://bun.com/guides/util/javascript-uuid) + - [Hash a password](https://bun.com/guides/util/hash-a-password) + - [Escape an HTML string](https://bun.com/guides/util/escape-html) + - [Get the current Bun version](https://bun.com/guides/util/version) + - [Encode and decode base64 strings](https://bun.com/guides/util/base64) + - [Compress and decompress data with gzip](https://bun.com/guides/util/gzip) + - [Sleep for a fixed number of milliseconds](https://bun.com/guides/util/sleep) + - [Detect when code is executed with Bun](https://bun.com/guides/util/detect-bun) + - [Check if two objects are deeply equal](https://bun.com/guides/util/deep-equals) + - [Compress and decompress data with DEFLATE](https://bun.com/guides/util/deflate) + - [Get the absolute path to the current entrypoint](https://bun.com/guides/util/main) + - [Get the directory of the current file](https://bun.com/guides/util/import-meta-dir) + - [Check if the current file is the entrypoint](https://bun.com/guides/util/entrypoint) + - [Get the file name of the current file](https://bun.com/guides/util/import-meta-file) + - [Convert a file URL to an absolute path](https://bun.com/guides/util/file-url-to-path) + - [Convert an absolute path to a file URL](https://bun.com/guides/util/path-to-file-url) + - [Get the absolute path of the current file](https://bun.com/guides/util/import-meta-path) + - [Get the path to an executable bin file](https://bun.com/guides/util/which-path-to-executable-bin) - WebSocket - - - [Build a publish-subscribe WebSocket server](https://bun.sh/guides/websocket/pubsub) - - [Build a simple WebSocket server](https://bun.sh/guides/websocket/simple) - - [Enable compression for WebSocket messages](https://bun.sh/guides/websocket/compression) - - [Set per-socket contextual data on a WebSocket](https://bun.sh/guides/websocket/context) + - [Build a publish-subscribe WebSocket server](https://bun.com/guides/websocket/pubsub) + - [Build a simple WebSocket server](https://bun.com/guides/websocket/simple) + - [Enable compression for WebSocket messages](https://bun.com/guides/websocket/compression) + - [Set per-socket contextual data on a WebSocket](https://bun.com/guides/websocket/context) - Write file - - - [Delete a file](https://bun.sh/guides/write-file/unlink) - - [Write to stdout](https://bun.sh/guides/write-file/stdout) - - [Write a file to stdout](https://bun.sh/guides/write-file/cat) - - [Write a Blob to a file](https://bun.sh/guides/write-file/blob) - - [Write a string to a file](https://bun.sh/guides/write-file/basic) - - [Append content to a file](https://bun.sh/guides/write-file/append) - - [Write a file incrementally](https://bun.sh/guides/write-file/filesink) - - [Write a Response to a file](https://bun.sh/guides/write-file/response) - - [Copy a file to another location](https://bun.sh/guides/write-file/file-cp) - - [Write a ReadableStream to a file](https://bun.sh/guides/write-file/stream) + - [Delete a file](https://bun.com/guides/write-file/unlink) + - [Write to stdout](https://bun.com/guides/write-file/stdout) + - [Write a file to stdout](https://bun.com/guides/write-file/cat) + - [Write a Blob to a file](https://bun.com/guides/write-file/blob) + - [Write a string to a file](https://bun.com/guides/write-file/basic) + - [Append content to a file](https://bun.com/guides/write-file/append) + - [Write a file incrementally](https://bun.com/guides/write-file/filesink) + - [Write a Response to a file](https://bun.com/guides/write-file/response) + - [Copy a file to another location](https://bun.com/guides/write-file/file-cp) + - [Write a ReadableStream to a file](https://bun.com/guides/write-file/stream) ## Contributing -Refer to the [Project > Contributing](https://bun.sh/docs/project/contributing) guide to start contributing to Bun. +Refer to the [Project > Contributing](https://bun.com/docs/project/contributing) guide to start contributing to Bun. ## License -Refer to the [Project > License](https://bun.sh/docs/project/licensing) page for information about Bun's licensing. +Refer to the [Project > License](https://bun.com/docs/project/licensing) page for information about Bun's licensing. diff --git a/SECURITY.md b/SECURITY.md index 5179a1ec70..f9402ed970 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -8,5 +8,4 @@ ## Reporting a Vulnerability -Report any discovered vulnerabilities to the Bun team by emailing `security@bun.sh`. Your report will acknowledged within 5 days, and a team member will be assigned as the primary handler. To the greatest extent possible, the security team will endeavor to keep you informed of the progress being made towards a fix and full announcement, and may ask for additional information or guidance surrounding the reported issue. - +Report any discovered vulnerabilities to the Bun team by emailing `security@bun.com`. Your report will acknowledged within 5 days, and a team member will be assigned as the primary handler. To the greatest extent possible, the security team will endeavor to keep you informed of the progress being made towards a fix and full announcement, and may ask for additional information or guidance surrounding the reported issue. diff --git a/bench/expect-to-equal/README.md b/bench/expect-to-equal/README.md index 3e7e3594b7..7f79d91198 100644 --- a/bench/expect-to-equal/README.md +++ b/bench/expect-to-equal/README.md @@ -40,4 +40,4 @@ vitest (node v18.11.0) > expect().toEqual() x 10000: 401.08ms -This project was created using `bun init` in bun v0.3.0. [Bun](https://bun.sh) is a fast all-in-one JavaScript runtime. +This project was created using `bun init` in bun v0.3.0. [Bun](https://bun.com) is a fast all-in-one JavaScript runtime. diff --git a/bench/snippets/dns-prefetch.mjs b/bench/snippets/dns-prefetch.mjs index 885be66100..5ea5e24098 100644 --- a/bench/snippets/dns-prefetch.mjs +++ b/bench/snippets/dns-prefetch.mjs @@ -9,7 +9,7 @@ // To clear your DNS cache on Windows: // ipconfig /flushdns // -const url = new URL(process.argv.length > 2 ? process.argv.at(-1) : "https://bun.sh"); +const url = new URL(process.argv.length > 2 ? process.argv.at(-1) : "https://bun.com"); const hostname = url.hostname; const port = url.port ? parseInt(url.port, 10) : url.protocol === "https:" ? 443 : 80; diff --git a/bench/websocket-server/README.md b/bench/websocket-server/README.md index c583e54bab..c3a8ef3575 100644 --- a/bench/websocket-server/README.md +++ b/bench/websocket-server/README.md @@ -34,4 +34,4 @@ For example, when the client sends `"foo"`, the server sends back `"John: foo"` The client script waits until it receives all the messages for each client before sending the next batch of messages. -This project was created using `bun init` in bun v0.2.1. [Bun](https://bun.sh) is a fast all-in-one JavaScript runtime. +This project was created using `bun init` in bun v0.2.1. [Bun](https://bun.com) is a fast all-in-one JavaScript runtime. diff --git a/docs/api/binary-data.md b/docs/api/binary-data.md index 8803765040..bd9bed578b 100644 --- a/docs/api/binary-data.md +++ b/docs/api/binary-data.md @@ -522,7 +522,7 @@ for await (const chunk of stream) { } ``` -For a more complete discussion of streams in Bun, see [API > Streams](https://bun.sh/docs/api/streams). +For a more complete discussion of streams in Bun, see [API > Streams](https://bun.com/docs/api/streams). ## Conversion diff --git a/docs/api/cc.md b/docs/api/cc.md index 0cdf0b0a75..383cdfaba0 100644 --- a/docs/api/cc.md +++ b/docs/api/cc.md @@ -2,7 +2,7 @@ ## Usage (cc in `bun:ffi`) -See the [introduction blog post](https://bun.sh/blog/compile-and-run-c-in-js) for more information. +See the [introduction blog post](https://bun.com/blog/compile-and-run-c-in-js) for more information. JavaScript: diff --git a/docs/api/dns.md b/docs/api/dns.md index 5cb50ee549..68a90631d2 100644 --- a/docs/api/dns.md +++ b/docs/api/dns.md @@ -3,7 +3,7 @@ Bun implements the `node:dns` module. ```ts import * as dns from "node:dns"; -const addrs = await dns.promises.resolve4("bun.sh", { ttl: true }); +const addrs = await dns.promises.resolve4("bun.com", { ttl: true }); console.log(addrs); // => [{ address: "172.67.161.226", family: 4, ttl: 0 }, ...] ``` @@ -54,10 +54,10 @@ Here's an example: ```ts import { dns } from "bun"; -dns.prefetch("bun.sh", 443); +dns.prefetch("bun.com", 443); // // ... sometime later ... -await fetch("https://bun.sh"); +await fetch("https://bun.com"); ``` ### `dns.getCacheStats()` diff --git a/docs/api/fetch.md b/docs/api/fetch.md index 80aaecc46c..3a69755488 100644 --- a/docs/api/fetch.md +++ b/docs/api/fetch.md @@ -267,7 +267,7 @@ const response = await fetch("s3://my-bucket/path/to/object", { Note: Only PUT and POST methods support request bodies when using S3. For uploads, Bun automatically uses multipart upload for streaming bodies. -You can read more about Bun's S3 support in the [S3](https://bun.sh/docs/api/s3) documentation. +You can read more about Bun's S3 support in the [S3](https://bun.com/docs/api/s3) documentation. #### File URLs - `file://` @@ -376,14 +376,14 @@ To prefetch a DNS entry, you can use the `dns.prefetch` API. This API is useful ```ts import { dns } from "bun"; -dns.prefetch("bun.sh"); +dns.prefetch("bun.com"); ``` #### DNS caching By default, Bun caches and deduplicates DNS queries in-memory for up to 30 seconds. You can see the cache stats by calling `dns.getCacheStats()`: -To learn more about DNS caching in Bun, see the [DNS caching](https://bun.sh/docs/api/dns) documentation. +To learn more about DNS caching in Bun, see the [DNS caching](https://bun.com/docs/api/dns) documentation. ### Preconnect to a host @@ -392,7 +392,7 @@ To preconnect to a host, you can use the `fetch.preconnect` API. This API is use ```ts import { fetch } from "bun"; -fetch.preconnect("https://bun.sh"); +fetch.preconnect("https://bun.com"); ``` Note: calling `fetch` immediately after `fetch.preconnect` will not make your request faster. Preconnecting only helps if you know you'll need to connect to a host soon, but you're not ready to make the request yet. @@ -402,7 +402,7 @@ Note: calling `fetch` immediately after `fetch.preconnect` will not make your re To preconnect to a host at startup, you can pass `--fetch-preconnect`: ```sh -$ bun --fetch-preconnect https://bun.sh ./my-script.ts +$ bun --fetch-preconnect https://bun.com ./my-script.ts ``` This is sort of like `` in HTML. diff --git a/docs/api/file-io.md b/docs/api/file-io.md index f8e3102783..506ec9b051 100644 --- a/docs/api/file-io.md +++ b/docs/api/file-io.md @@ -1,8 +1,8 @@ {% callout %} - + -**Note** — The `Bun.file` and `Bun.write` APIs documented on this page are heavily optimized and represent the recommended way to perform file-system tasks using Bun. For operations that are not yet available with `Bun.file`, such as `mkdir` or `readdir`, you can use Bun's [nearly complete](https://bun.sh/docs/runtime/nodejs-apis#node-fs) implementation of the [`node:fs`](https://nodejs.org/api/fs.html) module. +**Note** — The `Bun.file` and `Bun.write` APIs documented on this page are heavily optimized and represent the recommended way to perform file-system tasks using Bun. For operations that are not yet available with `Bun.file`, such as `mkdir` or `readdir`, you can use Bun's [nearly complete](https://bun.com/docs/runtime/nodejs-apis#node-fs) implementation of the [`node:fs`](https://nodejs.org/api/fs.html) module. {% /callout %} @@ -208,7 +208,7 @@ await Bun.write(Bun.stdout, input); To write the body of an HTTP response to disk: ```ts -const response = await fetch("https://bun.sh"); +const response = await fetch("https://bun.com"); await Bun.write("index.html", response); ``` diff --git a/docs/api/globals.md b/docs/api/globals.md index 8e5a89651a..1a98bb0899 100644 --- a/docs/api/globals.md +++ b/docs/api/globals.md @@ -34,7 +34,7 @@ Bun implements the following globals. - [`Buffer`](https://nodejs.org/api/buffer.html#class-buffer) - Node.js -- See [Node.js > `Buffer`](https://bun.sh/docs/runtime/nodejs-apis#node-buffer) +- See [Node.js > `Buffer`](https://bun.com/docs/runtime/nodejs-apis#node-buffer) --- @@ -172,7 +172,7 @@ Bun implements the following globals. - [`global`](https://nodejs.org/api/globals.html#global) - Node.js -- See [Node.js > `global`](https://bun.sh/docs/runtime/nodejs-apis#global). +- See [Node.js > `global`](https://bun.com/docs/runtime/nodejs-apis#global). --- @@ -188,7 +188,7 @@ Bun implements the following globals. --- -- [`HTMLRewriter`](https://bun.sh/docs/api/html-rewriter) +- [`HTMLRewriter`](https://bun.com/docs/api/html-rewriter) - Cloudflare -   @@ -220,7 +220,7 @@ Bun implements the following globals. - [`process`](https://nodejs.org/api/process.html) - Node.js -- See [Node.js > `process`](https://bun.sh/docs/runtime/nodejs-apis#node-process) +- See [Node.js > `process`](https://bun.com/docs/runtime/nodejs-apis#node-process) --- diff --git a/docs/api/http.md b/docs/api/http.md index 0a0c959e48..e5b052fed9 100644 --- a/docs/api/http.md +++ b/docs/api/http.md @@ -1,7 +1,7 @@ The page primarily documents the Bun-native `Bun.serve` API. Bun also implements [`fetch`](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) and the Node.js [`http`](https://nodejs.org/api/http.html) and [`https`](https://nodejs.org/api/https.html) modules. {% callout %} -These modules have been re-implemented to use Bun's fast internal HTTP infrastructure. Feel free to use these modules directly; frameworks like [Express](https://expressjs.com/) that depend on these modules should work out of the box. For granular compatibility information, see [Runtime > Node.js APIs](https://bun.sh/docs/runtime/nodejs-apis). +These modules have been re-implemented to use Bun's fast internal HTTP infrastructure. Feel free to use these modules directly; frameworks like [Express](https://expressjs.com/) that depend on these modules should work out of the box. For granular compatibility information, see [Runtime > Node.js APIs](https://bun.com/docs/runtime/nodejs-apis). {% /callout %} To start a high-performance HTTP server with a clean API, the recommended approach is [`Bun.serve`](#start-a-server-bun-serve). @@ -149,7 +149,7 @@ Bun.serve({ }), // Redirects - "/blog": Response.redirect("https://bun.sh/blog"), + "/blog": Response.redirect("https://bun.com/blog"), // API responses "/api/config": Response.json({ @@ -342,9 +342,9 @@ Bun.serve({ }); ``` -HTML imports don't just serve HTML — it's a full-featured frontend bundler, transpiler, and toolkit built using Bun's [bundler](https://bun.sh/docs/bundler), JavaScript transpiler and CSS parser. You can use this to build full-featured frontends with React, TypeScript, Tailwind CSS, and more. +HTML imports don't just serve HTML — it's a full-featured frontend bundler, transpiler, and toolkit built using Bun's [bundler](https://bun.com/docs/bundler), JavaScript transpiler and CSS parser. You can use this to build full-featured frontends with React, TypeScript, Tailwind CSS, and more. -For a complete guide on building full-stack applications with HTML imports, including detailed examples and best practices, see [/docs/bundler/fullstack](https://bun.sh/docs/bundler/fullstack). +For a complete guide on building full-stack applications with HTML imports, including detailed examples and best practices, see [/docs/bundler/fullstack](https://bun.com/docs/bundler/fullstack). ### Practical example: REST API @@ -605,7 +605,7 @@ Bun.serve({ ``` {% callout %} -[Learn more about debugging in Bun](https://bun.sh/docs/runtime/debugger) +[Learn more about debugging in Bun](https://bun.com/docs/runtime/debugger) {% /callout %} The call to `Bun.serve` returns a `Server` object. To stop the server, call the `.stop()` method. @@ -772,7 +772,7 @@ Instead of passing the server options into `Bun.serve`, `export default` it. Thi $ bun --hot server.ts ``` --> - + ## Streaming files diff --git a/docs/api/s3.md b/docs/api/s3.md index 3cde81fc7d..68dae77a39 100644 --- a/docs/api/s3.md +++ b/docs/api/s3.md @@ -4,7 +4,7 @@ Production servers often read, upload, and write files to S3-compatible object s ### Bun's S3 API is fast -{% image src="https://bun.sh/bun-s3-node.gif" alt="Bun's S3 API is fast" caption="Left: Bun v1.1.44. Right: Node.js v23.6.0" /%} +{% image src="https://bun.com/bun-s3-node.gif" alt="Bun's S3 API is fast" caption="Left: Bun v1.1.44. Right: Node.js v23.6.0" /%} {% /callout %} diff --git a/docs/api/utils.md b/docs/api/utils.md index 2d04163c72..76571fd97d 100644 --- a/docs/api/utils.md +++ b/docs/api/utils.md @@ -234,7 +234,7 @@ const currentFile = import.meta.url; Bun.openInEditor(currentFile); ``` -You can override this via the `debug.editor` setting in your [`bunfig.toml`](https://bun.sh/docs/runtime/bunfig). +You can override this via the `debug.editor` setting in your [`bunfig.toml`](https://bun.com/docs/runtime/bunfig). ```toml-diff#bunfig.toml + [debug] @@ -704,7 +704,7 @@ Bun.nanoseconds(); Bun implements a set of convenience functions for asynchronously consuming the body of a `ReadableStream` and converting it to various binary formats. ```ts -const stream = (await fetch("https://bun.sh")).body; +const stream = (await fetch("https://bun.com")).body; stream; // => ReadableStream await Bun.readableStreamToArrayBuffer(stream); @@ -787,7 +787,7 @@ const buffer = Buffer.alloc(1024 * 1024); estimateShallowMemoryUsageOf(buffer); // => 1048624 -const req = new Request("https://bun.sh"); +const req = new Request("https://bun.com"); estimateShallowMemoryUsageOf(req); // => 167 diff --git a/docs/bundler/fullstack.md b/docs/bundler/fullstack.md index 587afe8c60..16ed1d8402 100644 --- a/docs/bundler/fullstack.md +++ b/docs/bundler/fullstack.md @@ -325,7 +325,7 @@ When adding a build step is too complicated, you can set `development: false` in ## Plugins -Bun's [bundler plugins](https://bun.sh/docs/bundler/plugins) are also supported when bundling static routes. +Bun's [bundler plugins](https://bun.com/docs/bundler/plugins) are also supported when bundling static routes. To configure plugins for `Bun.serve`, add a `plugins` array in the `[serve.static]` section of your `bunfig.toml`. @@ -365,7 +365,7 @@ Or in your CSS: ### Custom plugins -Any JS file or module which exports a [valid bundler plugin object](https://bun.sh/docs/bundler/plugins#usage) (essentially an object with a `name` and `setup` field) can be placed inside the `plugins` array: +Any JS file or module which exports a [valid bundler plugin object](https://bun.com/docs/bundler/plugins#usage) (essentially an object with a `name` and `setup` field) can be placed inside the `plugins` array: ```toml#bunfig.toml [serve.static] diff --git a/docs/bundler/index.md b/docs/bundler/index.md index a889343eee..9442ae8680 100644 --- a/docs/bundler/index.md +++ b/docs/bundler/index.md @@ -147,7 +147,7 @@ $ bun build ./index.tsx --outdir ./out --watch ## Content types -Like the Bun runtime, the bundler supports an array of file types out of the box. The following table breaks down the bundler's set of standard "loaders". Refer to [Bundler > File types](https://bun.sh/docs/runtime/loaders) for full documentation. +Like the Bun runtime, the bundler supports an array of file types out of the box. The following table breaks down the bundler's set of standard "loaders". Refer to [Bundler > File types](https://bun.com/docs/runtime/loaders) for full documentation. {% table %} @@ -220,11 +220,11 @@ console.log(logo); The exact behavior of the file loader is also impacted by [`naming`](#naming) and [`publicPath`](#publicpath). {% /callout %} -Refer to the [Bundler > Loaders](https://bun.sh/docs/bundler/loaders#file) page for more complete documentation on the file loader. +Refer to the [Bundler > Loaders](https://bun.com/docs/bundler/loaders#file) page for more complete documentation on the file loader. ### Plugins -The behavior described in this table can be overridden or extended with [plugins](https://bun.sh/docs/bundler/plugins). Refer to the [Bundler > Loaders](https://bun.sh/docs/bundler/plugins) page for complete documentation. +The behavior described in this table can be overridden or extended with [plugins](https://bun.com/docs/bundler/plugins). Refer to the [Bundler > Loaders](https://bun.com/docs/bundler/plugins) page for complete documentation. ## API @@ -484,7 +484,7 @@ n/a {% /codetabs %} -Bun implements a universal plugin system for both Bun's runtime and bundler. Refer to the [plugin documentation](https://bun.sh/docs/bundler/plugins) for complete documentation. +Bun implements a universal plugin system for both Bun's runtime and bundler. Refer to the [plugin documentation](https://bun.com/docs/bundler/plugins) for complete documentation. + Performance sensitive APIs like `Buffer`, `fetch`, and `Response` are heavily profiled and optimized. Under the hood Bun uses the [JavaScriptCore engine](https://developer.apple.com/documentation/javascriptcore), which is developed by Apple for Safari. It starts and runs faster than V8, the engine used by Node.js and Chromium-based browsers. @@ -21,7 +21,7 @@ $ bun index.ts $ bun index.tsx ``` -Some aspects of Bun's runtime behavior are affected by the contents of your `tsconfig.json` file. Refer to [Runtime > TypeScript](https://bun.sh/docs/runtime/typescript) page for details. +Some aspects of Bun's runtime behavior are affected by the contents of your `tsconfig.json` file. Refer to [Runtime > TypeScript](https://bun.com/docs/runtime/typescript) page for details. @@ -122,17 +122,17 @@ $ bun run ./my-wasm-app.whatever ## Node.js compatibility -Long-term, Bun aims for complete Node.js compatibility. Most Node.js packages already work with Bun out of the box, but certain low-level APIs like `dgram` are still unimplemented. Track the current compatibility status at [Ecosystem > Node.js](https://bun.sh/docs/runtime/nodejs-apis). +Long-term, Bun aims for complete Node.js compatibility. Most Node.js packages already work with Bun out of the box, but certain low-level APIs like `dgram` are still unimplemented. Track the current compatibility status at [Ecosystem > Node.js](https://bun.com/docs/runtime/nodejs-apis). Bun implements the Node.js module resolution algorithm, so dependencies can still be managed with `package.json`, `node_modules`, and CommonJS-style imports. {% callout %} -**Note** — We recommend using Bun's [built-in package manager](https://bun.sh/docs/cli/install) for a performance boost over other npm clients. +**Note** — We recommend using Bun's [built-in package manager](https://bun.com/docs/cli/install) for a performance boost over other npm clients. {% /callout %} ## Web APIs - + Some Web APIs aren't relevant in the context of a server-first runtime like Bun, such as the [DOM API](https://developer.mozilla.org/en-US/docs/Web/API/HTML_DOM_API#html_dom_api_interfaces) or [History API](https://developer.mozilla.org/en-US/docs/Web/API/History_API). Many others, though, are broadly useful outside of the browser context; when possible, Bun implements these Web-standard APIs instead of introducing new APIs. @@ -237,67 +237,67 @@ Bun exposes a set of Bun-specific APIs on the `Bun` global object and through a --- -- [HTTP](https://bun.sh/docs/api/http) +- [HTTP](https://bun.com/docs/api/http) - `Bun.serve` --- -- [File I/O](https://bun.sh/docs/api/file-io) +- [File I/O](https://bun.com/docs/api/file-io) - `Bun.file` `Bun.write` --- -- [Processes](https://bun.sh/docs/api/spawn) +- [Processes](https://bun.com/docs/api/spawn) - `Bun.spawn` `Bun.spawnSync` --- -- [TCP](https://bun.sh/docs/api/tcp) +- [TCP](https://bun.com/docs/api/tcp) - `Bun.listen` `Bun.connect` --- -- [Transpiler](https://bun.sh/docs/api/transpiler) +- [Transpiler](https://bun.com/docs/api/transpiler) - `Bun.Transpiler` --- -- [Routing](https://bun.sh/docs/api/file-system-router) +- [Routing](https://bun.com/docs/api/file-system-router) - `Bun.FileSystemRouter` --- -- [HTMLRewriter](https://bun.sh/docs/api/html-rewriter) +- [HTMLRewriter](https://bun.com/docs/api/html-rewriter) - `HTMLRewriter` --- -- [Utils](https://bun.sh/docs/api/utils) +- [Utils](https://bun.com/docs/api/utils) - `Bun.peek` `Bun.which` --- -- [SQLite](https://bun.sh/docs/api/sqlite) +- [SQLite](https://bun.com/docs/api/sqlite) - `bun:sqlite` --- -- [FFI](https://bun.sh/docs/api/ffi) +- [FFI](https://bun.com/docs/api/ffi) - `bun:ffi` --- -- [DNS](https://bun.sh/docs/api/dns) +- [DNS](https://bun.com/docs/api/dns) - `bun:dns` --- -- [Testing](https://bun.sh/docs/api/test) +- [Testing](https://bun.com/docs/api/test) - `bun:test` --- -- [Node-API](https://bun.sh/docs/api/node-api) +- [Node-API](https://bun.com/docs/api/node-api) - `Node-API` --- @@ -306,4 +306,4 @@ Bun exposes a set of Bun-specific APIs on the `Bun` global object and through a ## Plugins -Support for additional file types can be implemented with plugins. Refer to [Runtime > Plugins](https://bun.sh/docs/bundler/plugins) for full documentation. +Support for additional file types can be implemented with plugins. Refer to [Runtime > Plugins](https://bun.com/docs/bundler/plugins) for full documentation. diff --git a/docs/runtime/jsx.md b/docs/runtime/jsx.md index ab08255599..f5ad0dc271 100644 --- a/docs/runtime/jsx.md +++ b/docs/runtime/jsx.md @@ -14,7 +14,7 @@ console.log(); ## Configuration -Bun reads your `tsconfig.json` or `jsconfig.json` configuration files to determines how to perform the JSX transform internally. To avoid using either of these, the following options can also be defined in [`bunfig.toml`](https://bun.sh/docs/runtime/bunfig). +Bun reads your `tsconfig.json` or `jsconfig.json` configuration files to determines how to perform the JSX transform internally. To avoid using either of these, the following options can also be defined in [`bunfig.toml`](https://bun.com/docs/runtime/bunfig). The following compiler options are respected. diff --git a/docs/runtime/loaders.md b/docs/runtime/loaders.md index 3909a1de90..18608f3020 100644 --- a/docs/runtime/loaders.md +++ b/docs/runtime/loaders.md @@ -9,7 +9,7 @@ $ bun index.ts $ bun index.tsx ``` -Some aspects of Bun's runtime behavior are affected by the contents of your `tsconfig.json` file. Refer to [Runtime > TypeScript](https://bun.sh/docs/runtime/typescript) page for details. +Some aspects of Bun's runtime behavior are affected by the contents of your `tsconfig.json` file. Refer to [Runtime > TypeScript](https://bun.com/docs/runtime/typescript) page for details. ## JSX @@ -89,11 +89,11 @@ import db from "./my.db" with { type: "sqlite" }; console.log(db.query("select * from users LIMIT 1").get()); ``` -This uses [`bun:sqlite`](https://bun.sh/docs/api/sqlite). +This uses [`bun:sqlite`](https://bun.com/docs/api/sqlite). ## Custom loaders -Support for additional file types can be implemented with plugins. Refer to [Runtime > Plugins](https://bun.sh/docs/bundler/plugins) for full documentation. +Support for additional file types can be implemented with plugins. Refer to [Runtime > Plugins](https://bun.com/docs/bundler/plugins) for full documentation.