bun-types 1.3.2-canary.20251105T140650 → 1.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bun.d.ts +102 -6
- package/docs/README.md +28 -0
- package/docs/bundler/bytecode.mdx +465 -0
- package/docs/bundler/{css.md → css.mdx} +97 -101
- package/docs/bundler/esbuild.mdx +253 -0
- package/docs/bundler/{executables.md → executables.mdx} +130 -221
- package/docs/bundler/fullstack.mdx +1064 -0
- package/docs/bundler/{hmr.md → hot-reloading.mdx} +74 -79
- package/docs/bundler/{html.md → html-static.mdx} +148 -111
- package/docs/bundler/index.mdx +1499 -0
- package/docs/bundler/loaders.mdx +356 -0
- package/docs/bundler/{macros.md → macros.mdx} +83 -84
- package/docs/bundler/minifier.mdx +1306 -0
- package/docs/bundler/plugins.mdx +411 -0
- package/docs/feedback.mdx +85 -0
- package/docs/guides/binary/{arraybuffer-to-array.md → arraybuffer-to-array.mdx} +3 -1
- package/docs/guides/binary/{arraybuffer-to-blob.md → arraybuffer-to-blob.mdx} +3 -1
- package/docs/guides/binary/{arraybuffer-to-buffer.md → arraybuffer-to-buffer.mdx} +3 -1
- package/docs/guides/binary/{arraybuffer-to-string.md → arraybuffer-to-string.mdx} +3 -1
- package/docs/guides/binary/{arraybuffer-to-typedarray.md → arraybuffer-to-typedarray.mdx} +3 -1
- package/docs/guides/binary/{blob-to-arraybuffer.md → blob-to-arraybuffer.mdx} +3 -1
- package/docs/guides/binary/{blob-to-dataview.md → blob-to-dataview.mdx} +3 -1
- package/docs/guides/binary/{blob-to-stream.md → blob-to-stream.mdx} +3 -1
- package/docs/guides/binary/{blob-to-string.md → blob-to-string.mdx} +3 -1
- package/docs/guides/binary/{blob-to-typedarray.md → blob-to-typedarray.mdx} +3 -1
- package/docs/guides/binary/{buffer-to-arraybuffer.md → buffer-to-arraybuffer.mdx} +3 -1
- package/docs/guides/binary/{buffer-to-blob.md → buffer-to-blob.mdx} +3 -1
- package/docs/guides/binary/{buffer-to-readablestream.md → buffer-to-readablestream.mdx} +3 -1
- package/docs/guides/binary/{buffer-to-string.md → buffer-to-string.mdx} +3 -1
- package/docs/guides/binary/{buffer-to-typedarray.md → buffer-to-typedarray.mdx} +3 -1
- package/docs/guides/binary/{dataview-to-string.md → dataview-to-string.mdx} +3 -1
- package/docs/guides/binary/{typedarray-to-arraybuffer.md → typedarray-to-arraybuffer.mdx} +3 -1
- package/docs/guides/binary/{typedarray-to-blob.md → typedarray-to-blob.mdx} +3 -1
- package/docs/guides/binary/{typedarray-to-buffer.md → typedarray-to-buffer.mdx} +3 -1
- package/docs/guides/binary/{typedarray-to-dataview.md → typedarray-to-dataview.mdx} +3 -1
- package/docs/guides/binary/{typedarray-to-readablestream.md → typedarray-to-readablestream.mdx} +3 -1
- package/docs/guides/binary/{typedarray-to-string.md → typedarray-to-string.mdx} +3 -1
- package/docs/guides/deployment/aws-lambda.mdx +204 -0
- package/docs/guides/deployment/digital-ocean.mdx +161 -0
- package/docs/guides/deployment/google-cloud-run.mdx +197 -0
- package/docs/guides/deployment/{railway.md → railway.mdx} +42 -54
- package/docs/guides/deployment/render.mdx +82 -0
- package/docs/guides/deployment/vercel.mdx +99 -0
- package/docs/guides/ecosystem/{astro.md → astro.mdx} +16 -6
- package/docs/guides/ecosystem/{discordjs.md → discordjs.mdx} +21 -18
- package/docs/guides/ecosystem/{docker.md → docker.mdx} +25 -14
- package/docs/guides/ecosystem/{drizzle.md → drizzle.mdx} +32 -22
- package/docs/guides/ecosystem/{edgedb.md → edgedb.mdx} +63 -34
- package/docs/guides/ecosystem/{elysia.md → elysia.mdx} +11 -11
- package/docs/guides/ecosystem/{express.md → express.mdx} +12 -9
- package/docs/guides/ecosystem/{hono.md → hono.mdx} +16 -8
- package/docs/guides/ecosystem/{mongoose.md → mongoose.mdx} +26 -21
- package/docs/guides/ecosystem/{neon-drizzle.md → neon-drizzle.mdx} +49 -35
- package/docs/guides/ecosystem/{neon-serverless-postgres.md → neon-serverless-postgres.mdx} +16 -11
- package/docs/guides/ecosystem/{nextjs.md → nextjs.mdx} +18 -10
- package/docs/guides/ecosystem/{nuxt.md → nuxt.mdx} +45 -11
- package/docs/guides/ecosystem/{pm2.md → pm2.mdx} +7 -9
- package/docs/guides/ecosystem/prisma-postgres.mdx +169 -0
- package/docs/guides/ecosystem/prisma.mdx +164 -0
- package/docs/guides/ecosystem/{qwik.md → qwik.mdx} +18 -11
- package/docs/guides/ecosystem/{react.md → react.mdx} +9 -7
- package/docs/guides/ecosystem/{remix.md → remix.mdx} +45 -26
- package/docs/guides/ecosystem/{sentry.md → sentry.mdx} +7 -5
- package/docs/guides/ecosystem/{solidstart.md → solidstart.mdx} +21 -13
- package/docs/guides/ecosystem/{ssr-react.md → ssr-react.mdx} +9 -11
- package/docs/guides/ecosystem/{stric.md → stric.mdx} +16 -17
- package/docs/guides/ecosystem/{sveltekit.md → sveltekit.mdx} +42 -29
- package/docs/guides/ecosystem/{systemd.md → systemd.mdx} +27 -26
- package/docs/guides/ecosystem/upstash.mdx +87 -0
- package/docs/guides/ecosystem/{vite.md → vite.mdx} +20 -14
- package/docs/guides/html-rewriter/{extract-links.md → extract-links.mdx} +11 -7
- package/docs/guides/html-rewriter/{extract-social-meta.md → extract-social-meta.mdx} +6 -2
- package/docs/guides/http/{cluster.md → cluster.mdx} +10 -7
- package/docs/guides/http/{fetch-unix.md → fetch-unix.mdx} +5 -3
- package/docs/guides/http/{fetch.md → fetch.mdx} +5 -3
- package/docs/guides/http/{file-uploads.md → file-uploads.mdx} +18 -15
- package/docs/guides/http/{hot.md → hot.mdx} +9 -7
- package/docs/guides/http/{proxy.md → proxy.mdx} +7 -5
- package/docs/guides/http/{server.md → server.mdx} +4 -2
- package/docs/guides/http/{simple.md → simple.mdx} +4 -2
- package/docs/guides/http/{stream-file.md → stream-file.mdx} +6 -4
- package/docs/guides/http/{stream-iterator.md → stream-iterator.mdx} +5 -3
- package/docs/guides/http/{stream-node-streams-in-bun.md → stream-node-streams-in-bun.mdx} +4 -2
- package/docs/guides/http/{tls.md → tls.mdx} +5 -3
- package/docs/guides/index.mdx +10 -0
- package/docs/guides/install/{add-dev.md → add-dev.mdx} +8 -6
- package/docs/guides/install/add-git.mdx +38 -0
- package/docs/guides/install/{add-optional.md → add-optional.mdx} +7 -5
- package/docs/guides/install/{add-peer.md → add-peer.mdx} +13 -11
- package/docs/guides/install/{add-tarball.md → add-tarball.mdx} +7 -5
- package/docs/guides/install/{add.md → add.mdx} +12 -10
- package/docs/guides/install/{azure-artifacts.md → azure-artifacts.mdx} +15 -12
- package/docs/guides/{runtime/cicd.md → install/cicd.mdx} +13 -13
- package/docs/guides/install/{custom-registry.md → custom-registry.mdx} +6 -4
- package/docs/guides/install/{from-npm-install-to-bun-install.md → from-npm-install-to-bun-install.mdx} +50 -34
- package/docs/guides/install/{git-diff-bun-lockfile.md → git-diff-bun-lockfile.mdx} +14 -11
- package/docs/guides/install/{jfrog-artifactory.md → jfrog-artifactory.mdx} +4 -4
- package/docs/guides/install/{npm-alias.md → npm-alias.mdx} +6 -4
- package/docs/guides/install/{registry-scope.md → registry-scope.mdx} +6 -4
- package/docs/guides/install/{trusted.md → trusted.mdx} +22 -18
- package/docs/guides/install/{workspaces.md → workspaces.mdx} +13 -13
- package/docs/guides/install/{yarnlock.md → yarnlock.mdx} +15 -9
- package/docs/guides/process/{argv.md → argv.mdx} +17 -9
- package/docs/guides/process/{ctrl-c.md → ctrl-c.mdx} +4 -2
- package/docs/guides/process/{ipc.md → ipc.mdx} +13 -10
- package/docs/guides/process/{nanoseconds.md → nanoseconds.mdx} +3 -1
- package/docs/guides/process/{os-signals.md → os-signals.mdx} +3 -1
- package/docs/guides/process/{spawn-stderr.md → spawn-stderr.mdx} +4 -1
- package/docs/guides/process/{spawn-stdout.md → spawn-stdout.mdx} +3 -1
- package/docs/guides/process/{spawn.md → spawn.mdx} +3 -1
- package/docs/guides/process/{stdin.md → stdin.mdx} +15 -7
- package/docs/guides/read-file/{arraybuffer.md → arraybuffer.mdx} +5 -3
- package/docs/guides/read-file/{buffer.md → buffer.mdx} +4 -2
- package/docs/guides/read-file/{exists.md → exists.mdx} +4 -2
- package/docs/guides/read-file/{json.md → json.mdx} +4 -2
- package/docs/guides/read-file/{mime.md → mime.mdx} +3 -1
- package/docs/guides/read-file/{stream.md → stream.mdx} +3 -1
- package/docs/guides/read-file/{string.md → string.mdx} +3 -1
- package/docs/guides/read-file/{uint8array.md → uint8array.mdx} +3 -1
- package/docs/guides/read-file/{watch.md → watch.mdx} +6 -8
- package/docs/guides/runtime/{build-time-constants.md → build-time-constants.mdx} +24 -22
- package/docs/guides/{install/cicd.md → runtime/cicd.mdx} +11 -7
- package/docs/guides/runtime/{codesign-macos-executable.md → codesign-macos-executable.mdx} +14 -9
- package/docs/guides/runtime/{define-constant.md → define-constant.mdx} +20 -16
- package/docs/guides/runtime/{delete-directory.md → delete-directory.mdx} +5 -3
- package/docs/guides/runtime/{delete-file.md → delete-file.mdx} +4 -2
- package/docs/guides/runtime/{heap-snapshot.md → heap-snapshot.mdx} +5 -3
- package/docs/guides/runtime/{import-html.md → import-html.mdx} +4 -2
- package/docs/guides/runtime/{import-json.md → import-json.mdx} +6 -4
- package/docs/guides/runtime/{import-toml.md → import-toml.mdx} +5 -3
- package/docs/guides/runtime/{import-yaml.md → import-yaml.mdx} +9 -7
- package/docs/guides/runtime/{read-env.md → read-env.mdx} +10 -5
- package/docs/guides/runtime/{set-env.md → set-env.mdx} +14 -10
- package/docs/guides/runtime/{shell.md → shell.mdx} +6 -4
- package/docs/guides/runtime/{timezone.md → timezone.mdx} +10 -7
- package/docs/guides/runtime/{tsconfig-paths.md → tsconfig-paths.mdx} +5 -3
- package/docs/guides/runtime/{typescript.md → typescript.mdx} +8 -6
- package/docs/guides/runtime/{vscode-debugger.md → vscode-debugger.mdx} +12 -11
- package/docs/guides/runtime/{web-debugger.md → web-debugger.mdx} +39 -18
- package/docs/guides/streams/{node-readable-to-arraybuffer.md → node-readable-to-arraybuffer.mdx} +3 -1
- package/docs/guides/streams/{node-readable-to-blob.md → node-readable-to-blob.mdx} +3 -1
- package/docs/guides/streams/{node-readable-to-json.md → node-readable-to-json.mdx} +3 -1
- package/docs/guides/streams/{node-readable-to-string.md → node-readable-to-string.mdx} +3 -1
- package/docs/guides/streams/{node-readable-to-uint8array.md → node-readable-to-uint8array.mdx} +3 -1
- package/docs/guides/streams/{to-array.md → to-array.mdx} +3 -1
- package/docs/guides/streams/{to-arraybuffer.md → to-arraybuffer.mdx} +3 -1
- package/docs/guides/streams/{to-blob.md → to-blob.mdx} +3 -1
- package/docs/guides/streams/{to-buffer.md → to-buffer.mdx} +3 -1
- package/docs/guides/streams/{to-json.md → to-json.mdx} +4 -2
- package/docs/guides/streams/{to-string.md → to-string.mdx} +3 -1
- package/docs/guides/streams/{to-typedarray.md → to-typedarray.mdx} +3 -1
- package/docs/guides/test/{bail.md → bail.mdx} +7 -5
- package/docs/guides/test/{coverage-threshold.md → coverage-threshold.mdx} +14 -7
- package/docs/guides/test/{coverage.md → coverage.mdx} +9 -4
- package/docs/guides/test/{happy-dom.md → happy-dom.mdx} +13 -8
- package/docs/guides/test/{migrate-from-jest.md → migrate-from-jest.mdx} +19 -37
- package/docs/guides/test/{mock-clock.md → mock-clock.mdx} +3 -1
- package/docs/guides/test/{mock-functions.md → mock-functions.mdx} +7 -5
- package/docs/guides/test/{rerun-each.md → rerun-each.mdx} +5 -3
- package/docs/guides/test/{run-tests.md → run-tests.mdx} +16 -11
- package/docs/guides/test/{skip-tests.md → skip-tests.mdx} +8 -4
- package/docs/guides/test/{snapshot.md → snapshot.mdx} +20 -13
- package/docs/guides/test/spy-on.mdx +49 -0
- package/docs/guides/test/{svelte-test.md → svelte-test.mdx} +16 -23
- package/docs/guides/test/{testing-library.md → testing-library.mdx} +18 -17
- package/docs/guides/test/{timeout.md → timeout.mdx} +5 -3
- package/docs/guides/test/{todo-tests.md → todo-tests.mdx} +13 -6
- package/docs/guides/test/{update-snapshots.md → update-snapshots.mdx} +9 -6
- package/docs/guides/test/{watch-mode.md → watch-mode.mdx} +9 -4
- package/docs/guides/util/{base64.md → base64.mdx} +3 -1
- package/docs/guides/util/{deep-equals.md → deep-equals.mdx} +5 -3
- package/docs/guides/util/{deflate.md → deflate.mdx} +3 -1
- package/docs/guides/util/{detect-bun.md → detect-bun.mdx} +3 -1
- package/docs/guides/util/{entrypoint.md → entrypoint.mdx} +4 -2
- package/docs/guides/util/{escape-html.md → escape-html.mdx} +3 -1
- package/docs/guides/util/{file-url-to-path.md → file-url-to-path.mdx} +3 -1
- package/docs/guides/util/{gzip.md → gzip.mdx} +3 -1
- package/docs/guides/util/{hash-a-password.md → hash-a-password.mdx} +3 -1
- package/docs/guides/util/{import-meta-dir.md → import-meta-dir.mdx} +4 -2
- package/docs/guides/util/{import-meta-file.md → import-meta-file.mdx} +4 -2
- package/docs/guides/util/{import-meta-path.md → import-meta-path.mdx} +4 -2
- package/docs/guides/util/{javascript-uuid.md → javascript-uuid.mdx} +3 -1
- package/docs/guides/util/{main.md → main.mdx} +19 -8
- package/docs/guides/util/{path-to-file-url.md → path-to-file-url.mdx} +3 -1
- package/docs/guides/util/{sleep.md → sleep.mdx} +3 -1
- package/docs/guides/util/{version.md → version.mdx} +6 -4
- package/docs/guides/util/{which-path-to-executable-bin.md → which-path-to-executable-bin.mdx} +4 -2
- package/docs/guides/websocket/{compression.md → compression.mdx} +5 -3
- package/docs/guides/websocket/{context.md → context.mdx} +9 -12
- package/docs/guides/websocket/{pubsub.md → pubsub.mdx} +5 -6
- package/docs/guides/websocket/{simple.md → simple.mdx} +5 -3
- package/docs/guides/write-file/{append.md → append.mdx} +3 -1
- package/docs/guides/write-file/{basic.md → basic.mdx} +3 -1
- package/docs/guides/write-file/{blob.md → blob.mdx} +3 -1
- package/docs/guides/write-file/{cat.md → cat.mdx} +4 -2
- package/docs/guides/write-file/{file-cp.md → file-cp.mdx} +3 -1
- package/docs/guides/write-file/{filesink.md → filesink.mdx} +3 -1
- package/docs/guides/write-file/{response.md → response.mdx} +3 -1
- package/docs/guides/write-file/{stdout.md → stdout.mdx} +3 -1
- package/docs/guides/write-file/{stream.md → stream.mdx} +3 -1
- package/docs/guides/write-file/{unlink.md → unlink.mdx} +3 -1
- package/docs/{index.md → index.mdx} +97 -41
- package/docs/installation.mdx +365 -0
- package/docs/{cli/bunx.md → pm/bunx.mdx} +25 -31
- package/docs/{install/catalogs.md → pm/catalogs.mdx} +18 -24
- package/docs/{cli/add.md → pm/cli/add.mdx} +61 -55
- package/docs/{install/audit.md → pm/cli/audit.mdx} +11 -8
- package/docs/{cli/install.md → pm/cli/install.mdx} +208 -81
- package/docs/{cli/link.md → pm/cli/link.mdx} +27 -19
- package/docs/{cli/outdated.md → pm/cli/outdated.mdx} +119 -12
- package/docs/{install/patch.md → pm/cli/patch.mdx} +25 -15
- package/docs/{cli/pm.md → pm/cli/pm.mdx} +96 -62
- package/docs/{cli/publish.md → pm/cli/publish.mdx} +38 -35
- package/docs/pm/cli/remove.mdx +16 -0
- package/docs/{cli/update.md → pm/cli/update.mdx} +26 -15
- package/docs/{cli/why.md → pm/cli/why.mdx} +27 -10
- package/docs/{cli/filter.md → pm/filter.mdx} +26 -14
- package/docs/{install/cache.md → pm/global-cache.mdx} +25 -12
- package/docs/{install/isolated.md → pm/isolated-installs.mdx} +32 -24
- package/docs/{install/lifecycle.md → pm/lifecycle.mdx} +20 -9
- package/docs/{install/lockfile.md → pm/lockfile.mdx} +18 -12
- package/docs/{install/npmrc.md → pm/npmrc.mdx} +30 -24
- package/docs/{install/overrides.md → pm/overrides.mdx} +47 -37
- package/docs/{install/registries.md → pm/scopes-registries.mdx} +8 -3
- package/docs/{install/security-scanner-api.md → pm/security-scanner-api.mdx} +22 -8
- package/docs/{install/workspaces.md → pm/workspaces.mdx} +17 -22
- package/docs/project/{benchmarking.md → benchmarking.mdx} +26 -11
- package/docs/project/{bindgen.md → bindgen.mdx} +12 -14
- package/docs/project/{building-windows.md → building-windows.mdx} +18 -47
- package/docs/project/{contributing.md → contributing.mdx} +56 -60
- package/docs/project/feedback.mdx +20 -0
- package/docs/project/license.mdx +78 -0
- package/docs/project/roadmap.mdx +8 -0
- package/docs/quickstart.mdx +240 -0
- package/docs/runtime/{autoimport.md → auto-install.mdx} +34 -31
- package/docs/{api/binary-data.md → runtime/binary-data.mdx} +77 -269
- package/docs/runtime/bun-apis.mdx +59 -0
- package/docs/runtime/{bunfig.md → bunfig.mdx} +95 -225
- package/docs/{api/cc.md → runtime/c-compiler.mdx} +16 -9
- package/docs/{api/spawn.md → runtime/child-process.mdx} +69 -119
- package/docs/{api/color.md → runtime/color.mdx} +6 -1
- package/docs/{api/console.md → runtime/console.mdx} +17 -7
- package/docs/{api/cookie.md → runtime/cookies.mdx} +24 -19
- package/docs/runtime/{debugger.md → debugger.mdx} +61 -51
- package/docs/runtime/environment-variables.mdx +214 -0
- package/docs/{api/ffi.md → runtime/ffi.mdx} +53 -45
- package/docs/{api/file-io.md → runtime/file-io.mdx} +41 -101
- package/docs/{api/file-system-router.md → runtime/file-system-router.mdx} +8 -2
- package/docs/{bundler/loaders.md → runtime/file-types.mdx} +56 -112
- package/docs/{api/glob.md → runtime/glob.mdx} +4 -1
- package/docs/runtime/globals.mdx +72 -0
- package/docs/{api/hashing.md → runtime/hashing.mdx} +18 -22
- package/docs/{api/html-rewriter.md → runtime/html-rewriter.mdx} +36 -30
- package/docs/runtime/http/cookies.mdx +79 -0
- package/docs/runtime/http/error-handling.mdx +40 -0
- package/docs/runtime/http/metrics.mdx +36 -0
- package/docs/runtime/http/routing.mdx +289 -0
- package/docs/runtime/http/server.mdx +647 -0
- package/docs/runtime/http/tls.mdx +101 -0
- package/docs/{api/websockets.md → runtime/http/websockets.mdx} +62 -231
- package/docs/{cli/run.md → runtime/index.mdx} +70 -108
- package/docs/runtime/jsx.mdx +115 -0
- package/docs/runtime/{modules.md → module-resolution.mdx} +83 -61
- package/docs/{api/dns.md → runtime/networking/dns.mdx} +23 -22
- package/docs/{api/fetch.md → runtime/networking/fetch.mdx} +10 -5
- package/docs/{api/tcp.md → runtime/networking/tcp.mdx} +59 -41
- package/docs/{api/udp.md → runtime/networking/udp.mdx} +14 -8
- package/docs/{api/node-api.md → runtime/node-api.mdx} +5 -0
- package/docs/runtime/{nodejs-apis.md → nodejs-compat.mdx} +9 -4
- package/docs/{bundler/plugins.md → runtime/plugins.mdx} +17 -61
- package/docs/{api/redis.md → runtime/redis.mdx} +65 -80
- package/docs/{api/s3.md → runtime/s3.mdx} +79 -66
- package/docs/{api/secrets.md → runtime/secrets.mdx} +27 -10
- package/docs/{api/semver.md → runtime/semver.mdx} +9 -4
- package/docs/runtime/{shell.md → shell.mdx} +52 -20
- package/docs/{api/sql.md → runtime/sql.mdx} +129 -99
- package/docs/{api/sqlite.md → runtime/sqlite.mdx} +162 -157
- package/docs/{api/streams.md → runtime/streams.mdx} +33 -31
- package/docs/{cli/bun-create.md → runtime/templating/create.mdx} +74 -143
- package/docs/{cli/init.md → runtime/templating/init.mdx} +24 -51
- package/docs/{api/transpiler.md → runtime/transpiler.mdx} +50 -38
- package/docs/{typescript.md → runtime/typescript.mdx} +7 -2
- package/docs/{api/utils.md → runtime/utils.mdx} +81 -50
- package/docs/runtime/{hot.md → watch-mode.mdx} +53 -37
- package/docs/runtime/web-apis.mdx +29 -0
- package/docs/{api/workers.md → runtime/workers.mdx} +28 -22
- package/docs/{api/yaml.md → runtime/yaml.mdx} +33 -232
- package/docs/snippets/cli/add.mdx +166 -0
- package/docs/snippets/cli/build.mdx +196 -0
- package/docs/snippets/cli/feedback.mdx +17 -0
- package/docs/snippets/cli/init.mdx +84 -0
- package/docs/snippets/cli/install.mdx +173 -0
- package/docs/snippets/cli/link.mdx +163 -0
- package/docs/snippets/cli/outdated.mdx +140 -0
- package/docs/snippets/cli/patch.mdx +171 -0
- package/docs/snippets/cli/publish.mdx +198 -0
- package/docs/snippets/cli/remove.mdx +146 -0
- package/docs/snippets/cli/run.mdx +293 -0
- package/docs/snippets/cli/test.mdx +100 -0
- package/docs/snippets/cli/update.mdx +144 -0
- package/docs/snippets/product-card.mdx +32 -0
- package/docs/snippets/product-tiles.mdx +94 -0
- package/docs/test/code-coverage.mdx +409 -0
- package/docs/test/configuration.mdx +467 -0
- package/docs/test/{time.md → dates-times.mdx} +23 -20
- package/docs/test/{discovery.md → discovery.mdx} +15 -10
- package/docs/test/dom.mdx +226 -0
- package/docs/{cli/test.md → test/index.mdx} +77 -94
- package/docs/test/lifecycle.mdx +348 -0
- package/docs/test/mocks.mdx +637 -0
- package/docs/test/{reporters.md → reporters.mdx} +15 -15
- package/docs/test/runtime-behavior.mdx +342 -0
- package/docs/test/snapshots.mdx +434 -0
- package/docs/test/writing-tests.mdx +635 -0
- package/docs/typescript.mdx +54 -0
- package/package.json +8 -6
- package/test.d.ts +2 -2
- package/docs/api/file.md +0 -19
- package/docs/api/globals.md +0 -387
- package/docs/api/http.md +0 -1408
- package/docs/api/import-meta.md +0 -69
- package/docs/benchmarks.md +0 -120
- package/docs/bun-flavored-toml.md +0 -42
- package/docs/bundler/css_modules.md +0 -145
- package/docs/bundler/fullstack.md +0 -418
- package/docs/bundler/index.md +0 -1735
- package/docs/bundler/intro.md +0 -75
- package/docs/bundler/vs-esbuild.md +0 -1127
- package/docs/cli/bun-completions.md +0 -3
- package/docs/cli/bun-install.md +0 -349
- package/docs/cli/bun-upgrade.md +0 -39
- package/docs/cli/info.md +0 -65
- package/docs/cli/patch-commit.md +0 -11
- package/docs/cli/remove.md +0 -7
- package/docs/cli/unlink.md +0 -9
- package/docs/contributing/upgrading-webkit.md +0 -57
- package/docs/ecosystem/elysia.md +0 -24
- package/docs/ecosystem/express.md +0 -37
- package/docs/ecosystem/hono.md +0 -18
- package/docs/ecosystem/react.md +0 -65
- package/docs/ecosystem/stric.md +0 -38
- package/docs/guides/ecosystem/prisma.md +0 -141
- package/docs/guides/ecosystem/render.md +0 -79
- package/docs/guides/install/add-git.md +0 -36
- package/docs/guides/test/spy-on.md +0 -46
- package/docs/install/index.md +0 -248
- package/docs/installation.md +0 -327
- package/docs/project/asan.md +0 -124
- package/docs/project/internals/build-process-for-ci.md +0 -75
- package/docs/project/licensing.md +0 -73
- package/docs/project/roadmap.md +0 -87
- package/docs/quickstart.md +0 -157
- package/docs/runtime/bun-apis.md +0 -207
- package/docs/runtime/env.md +0 -253
- package/docs/runtime/index.md +0 -312
- package/docs/runtime/jsx.md +0 -385
- package/docs/runtime/loaders.md +0 -130
- package/docs/runtime/plugins.md +0 -561
- package/docs/runtime/typescript.md +0 -139
- package/docs/runtime/web-apis.md +0 -128
- package/docs/test/configuration.md +0 -154
- package/docs/test/coverage.md +0 -142
- package/docs/test/dom.md +0 -75
- package/docs/test/examples/concurrent-test-glob.md +0 -132
- package/docs/test/hot.md +0 -15
- package/docs/test/lifecycle.md +0 -81
- package/docs/test/mocks.md +0 -313
- package/docs/test/runtime-behavior.md +0 -95
- package/docs/test/snapshots.md +0 -68
- package/docs/test/writing.md +0 -825
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "bunfig.toml"
|
|
3
|
+
description: "Configure Bun's behavior using its configuration file bunfig.toml"
|
|
4
|
+
---
|
|
5
|
+
|
|
1
6
|
Bun's behavior can be configured using its configuration file, `bunfig.toml`.
|
|
2
7
|
|
|
3
8
|
In general, Bun relies on pre-existing configuration files like `package.json` and `tsconfig.json` to configure its behavior. `bunfig.toml` is only necessary for configuring Bun-specific things. This file is optional, and Bun will work out of the box without it.
|
|
@@ -21,7 +26,7 @@ Bun's runtime behavior is configured using top-level fields in the `bunfig.toml`
|
|
|
21
26
|
|
|
22
27
|
An array of scripts/plugins to execute before running a file or script.
|
|
23
28
|
|
|
24
|
-
```toml
|
|
29
|
+
```toml title="bunfig.toml" icon="settings"
|
|
25
30
|
# scripts to run before `bun run`-ing a file or script
|
|
26
31
|
# register plugins by adding them to this list
|
|
27
32
|
preload = ["./preload.ts"]
|
|
@@ -31,7 +36,7 @@ preload = ["./preload.ts"]
|
|
|
31
36
|
|
|
32
37
|
Configure how Bun handles JSX. You can also set these fields in the `compilerOptions` of your `tsconfig.json`, but they are supported here as well for non-TypeScript projects.
|
|
33
38
|
|
|
34
|
-
```toml
|
|
39
|
+
```toml title="bunfig.toml" icon="settings"
|
|
35
40
|
jsx = "react"
|
|
36
41
|
jsxFactory = "h"
|
|
37
42
|
jsxFragment = "Fragment"
|
|
@@ -40,16 +45,16 @@ jsxImportSource = "react"
|
|
|
40
45
|
|
|
41
46
|
Refer to the tsconfig docs for more information on these fields.
|
|
42
47
|
|
|
43
|
-
- [jsx](https://www.typescriptlang.org/tsconfig#jsx)
|
|
44
|
-
- [jsxFactory](https://www.typescriptlang.org/tsconfig#jsxFactory)
|
|
45
|
-
- [jsxFragment](https://www.typescriptlang.org/tsconfig#jsxFragment)
|
|
46
|
-
- [jsxImportSource](https://www.typescriptlang.org/tsconfig#jsxImportSource)
|
|
48
|
+
- [`jsx`](https://www.typescriptlang.org/tsconfig#jsx)
|
|
49
|
+
- [`jsxFactory`](https://www.typescriptlang.org/tsconfig#jsxFactory)
|
|
50
|
+
- [`jsxFragment`](https://www.typescriptlang.org/tsconfig#jsxFragment)
|
|
51
|
+
- [`jsxImportSource`](https://www.typescriptlang.org/tsconfig#jsxImportSource)
|
|
47
52
|
|
|
48
53
|
### `smol`
|
|
49
54
|
|
|
50
55
|
Enable `smol` mode. This reduces memory usage at the cost of performance.
|
|
51
56
|
|
|
52
|
-
```toml
|
|
57
|
+
```toml title="bunfig.toml" icon="settings"
|
|
53
58
|
# Reduce memory usage at the cost of performance
|
|
54
59
|
smol = true
|
|
55
60
|
```
|
|
@@ -58,7 +63,7 @@ smol = true
|
|
|
58
63
|
|
|
59
64
|
Set the log level. This can be one of `"debug"`, `"warn"`, or `"error"`.
|
|
60
65
|
|
|
61
|
-
```toml
|
|
66
|
+
```toml title="bunfig.toml" icon="settings"
|
|
62
67
|
logLevel = "debug" # "debug" | "warn" | "error"
|
|
63
68
|
```
|
|
64
69
|
|
|
@@ -66,7 +71,7 @@ logLevel = "debug" # "debug" | "warn" | "error"
|
|
|
66
71
|
|
|
67
72
|
The `define` field allows you to replace certain global identifiers with constant expressions. Bun will replace any usage of the identifier with the expression. The expression should be a JSON string.
|
|
68
73
|
|
|
69
|
-
```toml
|
|
74
|
+
```toml title="bunfig.toml" icon="settings"
|
|
70
75
|
[define]
|
|
71
76
|
# Replace any usage of "process.env.bagel" with the string `lox`.
|
|
72
77
|
# The values are parsed as JSON, except single-quoted strings are supported and `'undefined'` becomes `undefined` in JS.
|
|
@@ -78,7 +83,7 @@ The `define` field allows you to replace certain global identifiers with constan
|
|
|
78
83
|
|
|
79
84
|
Configure how Bun maps file extensions to loaders. This is useful for loading files that aren't natively supported by Bun.
|
|
80
85
|
|
|
81
|
-
```toml
|
|
86
|
+
```toml title="bunfig.toml" icon="settings"
|
|
82
87
|
[loader]
|
|
83
88
|
# when a .bagel file is imported, treat it like a tsx file
|
|
84
89
|
".bagel" = "tsx"
|
|
@@ -94,7 +99,6 @@ Bun supports the following loaders:
|
|
|
94
99
|
- `file`
|
|
95
100
|
- `json`
|
|
96
101
|
- `toml`
|
|
97
|
-
- `yaml`
|
|
98
102
|
- `wasm`
|
|
99
103
|
- `napi`
|
|
100
104
|
- `base64`
|
|
@@ -105,7 +109,7 @@ Bun supports the following loaders:
|
|
|
105
109
|
|
|
106
110
|
The `telemetry` field permit to enable/disable the analytics records. Bun records bundle timings (so we can answer with data, "is Bun getting faster?") and feature usage (e.g., "are people actually using macros?"). The request body size is about 60 bytes, so it's not a lot of data. By default the telemetry is enabled. Equivalent of `DO_NOT_TRACK` env variable.
|
|
107
111
|
|
|
108
|
-
```toml
|
|
112
|
+
```toml title="bunfig.toml" icon="settings"
|
|
109
113
|
telemetry = false
|
|
110
114
|
```
|
|
111
115
|
|
|
@@ -117,7 +121,7 @@ Configure console output behavior.
|
|
|
117
121
|
|
|
118
122
|
Set the default depth for `console.log()` object inspection. Default `2`.
|
|
119
123
|
|
|
120
|
-
```toml
|
|
124
|
+
```toml title="bunfig.toml" icon="settings"
|
|
121
125
|
[console]
|
|
122
126
|
depth = 3
|
|
123
127
|
```
|
|
@@ -128,7 +132,7 @@ This controls how deeply nested objects are displayed in console output. Higher
|
|
|
128
132
|
|
|
129
133
|
The test runner is configured under the `[test]` section of your bunfig.toml.
|
|
130
134
|
|
|
131
|
-
```toml
|
|
135
|
+
```toml title="bunfig.toml" icon="settings"
|
|
132
136
|
[test]
|
|
133
137
|
# configuration goes here
|
|
134
138
|
```
|
|
@@ -137,7 +141,7 @@ The test runner is configured under the `[test]` section of your bunfig.toml.
|
|
|
137
141
|
|
|
138
142
|
The root directory to run tests from. Default `.`.
|
|
139
143
|
|
|
140
|
-
```toml
|
|
144
|
+
```toml title="bunfig.toml" icon="settings"
|
|
141
145
|
[test]
|
|
142
146
|
root = "./__tests__"
|
|
143
147
|
```
|
|
@@ -146,7 +150,7 @@ root = "./__tests__"
|
|
|
146
150
|
|
|
147
151
|
Same as the top-level `preload` field, but only applies to `bun test`.
|
|
148
152
|
|
|
149
|
-
```toml
|
|
153
|
+
```toml title="bunfig.toml" icon="settings"
|
|
150
154
|
[test]
|
|
151
155
|
preload = ["./setup.ts"]
|
|
152
156
|
```
|
|
@@ -155,7 +159,7 @@ preload = ["./setup.ts"]
|
|
|
155
159
|
|
|
156
160
|
Same as the top-level `smol` field, but only applies to `bun test`.
|
|
157
161
|
|
|
158
|
-
```toml
|
|
162
|
+
```toml title="bunfig.toml" icon="settings"
|
|
159
163
|
[test]
|
|
160
164
|
smol = true
|
|
161
165
|
```
|
|
@@ -164,7 +168,7 @@ smol = true
|
|
|
164
168
|
|
|
165
169
|
Enables coverage reporting. Default `false`. Use `--coverage` to override.
|
|
166
170
|
|
|
167
|
-
```toml
|
|
171
|
+
```toml title="bunfig.toml" icon="settings"
|
|
168
172
|
[test]
|
|
169
173
|
coverage = false
|
|
170
174
|
```
|
|
@@ -173,7 +177,7 @@ coverage = false
|
|
|
173
177
|
|
|
174
178
|
To specify a coverage threshold. By default, no threshold is set. If your test suite does not meet or exceed this threshold, `bun test` will exit with a non-zero exit code to indicate the failure.
|
|
175
179
|
|
|
176
|
-
```toml
|
|
180
|
+
```toml title="bunfig.toml" icon="settings"
|
|
177
181
|
[test]
|
|
178
182
|
|
|
179
183
|
# to require 90% line-level and function-level coverage
|
|
@@ -182,7 +186,7 @@ coverageThreshold = 0.9
|
|
|
182
186
|
|
|
183
187
|
Different thresholds can be specified for line-wise, function-wise, and statement-wise coverage.
|
|
184
188
|
|
|
185
|
-
```toml
|
|
189
|
+
```toml title="bunfig.toml" icon="settings"
|
|
186
190
|
[test]
|
|
187
191
|
coverageThreshold = { line = 0.7, function = 0.8, statement = 0.9 }
|
|
188
192
|
```
|
|
@@ -191,7 +195,7 @@ coverageThreshold = { line = 0.7, function = 0.8, statement = 0.9 }
|
|
|
191
195
|
|
|
192
196
|
Whether to skip test files when computing coverage statistics. Default `false`.
|
|
193
197
|
|
|
194
|
-
```toml
|
|
198
|
+
```toml title="bunfig.toml" icon="settings"
|
|
195
199
|
[test]
|
|
196
200
|
coverageSkipTestFiles = false
|
|
197
201
|
```
|
|
@@ -200,7 +204,7 @@ coverageSkipTestFiles = false
|
|
|
200
204
|
|
|
201
205
|
Exclude specific files or file patterns from coverage reports using glob patterns. Can be a single string pattern or an array of patterns.
|
|
202
206
|
|
|
203
|
-
```toml
|
|
207
|
+
```toml title="bunfig.toml" icon="settings"
|
|
204
208
|
[test]
|
|
205
209
|
# Single pattern
|
|
206
210
|
coveragePathIgnorePatterns = "**/*.spec.ts"
|
|
@@ -218,7 +222,7 @@ coveragePathIgnorePatterns = [
|
|
|
218
222
|
|
|
219
223
|
By default, coverage reports will be printed to the console. For persistent code coverage reports in CI environments and for other tools use `lcov`.
|
|
220
224
|
|
|
221
|
-
```toml
|
|
225
|
+
```toml title="bunfig.toml" icon="settings"
|
|
222
226
|
[test]
|
|
223
227
|
coverageReporter = ["text", "lcov"] # default ["text"]
|
|
224
228
|
```
|
|
@@ -227,68 +231,16 @@ coverageReporter = ["text", "lcov"] # default ["text"]
|
|
|
227
231
|
|
|
228
232
|
Set path where coverage reports will be saved. Please notice, that it works only for persistent `coverageReporter` like `lcov`.
|
|
229
233
|
|
|
230
|
-
```toml
|
|
234
|
+
```toml title="bunfig.toml" icon="settings"
|
|
231
235
|
[test]
|
|
232
236
|
coverageDir = "path/to/somewhere" # default "coverage"
|
|
233
237
|
```
|
|
234
238
|
|
|
235
|
-
### `test.concurrentTestGlob`
|
|
236
|
-
|
|
237
|
-
Specify a glob pattern to automatically run matching test files with concurrent test execution enabled. Test files matching this pattern will behave as if the `--concurrent` flag was passed, running all tests within those files concurrently.
|
|
238
|
-
|
|
239
|
-
```toml
|
|
240
|
-
[test]
|
|
241
|
-
concurrentTestGlob = "**/concurrent-*.test.ts"
|
|
242
|
-
```
|
|
243
|
-
|
|
244
|
-
This is useful for:
|
|
245
|
-
|
|
246
|
-
- Gradually migrating test suites to concurrent execution
|
|
247
|
-
- Running integration tests concurrently while keeping unit tests sequential
|
|
248
|
-
- Separating fast concurrent tests from tests that require sequential execution
|
|
249
|
-
|
|
250
|
-
The `--concurrent` CLI flag will override this setting when specified.
|
|
251
|
-
|
|
252
|
-
### `test.onlyFailures`
|
|
253
|
-
|
|
254
|
-
When enabled, only failed tests are displayed in the output. This helps reduce noise in large test suites by hiding passing tests. Default `false`.
|
|
255
|
-
|
|
256
|
-
```toml
|
|
257
|
-
[test]
|
|
258
|
-
onlyFailures = true
|
|
259
|
-
```
|
|
260
|
-
|
|
261
|
-
This is equivalent to using the `--only-failures` flag when running `bun test`.
|
|
262
|
-
|
|
263
|
-
### `test.reporter`
|
|
264
|
-
|
|
265
|
-
Configure the test reporter settings.
|
|
266
|
-
|
|
267
|
-
#### `test.reporter.dots`
|
|
268
|
-
|
|
269
|
-
Enable the dots reporter, which displays a compact output showing a dot for each test. Default `false`.
|
|
270
|
-
|
|
271
|
-
```toml
|
|
272
|
-
[test.reporter]
|
|
273
|
-
dots = true
|
|
274
|
-
```
|
|
275
|
-
|
|
276
|
-
#### `test.reporter.junit`
|
|
277
|
-
|
|
278
|
-
Enable JUnit XML reporting and specify the output file path.
|
|
279
|
-
|
|
280
|
-
```toml
|
|
281
|
-
[test.reporter]
|
|
282
|
-
junit = "test-results.xml"
|
|
283
|
-
```
|
|
284
|
-
|
|
285
|
-
This generates a JUnit XML report that can be consumed by CI systems and other tools.
|
|
286
|
-
|
|
287
239
|
### `test.randomize`
|
|
288
240
|
|
|
289
241
|
Run tests in random order. Default `false`.
|
|
290
242
|
|
|
291
|
-
```toml
|
|
243
|
+
```toml title="bunfig.toml" icon="settings"
|
|
292
244
|
[test]
|
|
293
245
|
randomize = true
|
|
294
246
|
```
|
|
@@ -301,7 +253,7 @@ The `--randomize` CLI flag will override this setting when specified.
|
|
|
301
253
|
|
|
302
254
|
Set the random seed for test randomization. This option requires `randomize` to be `true`.
|
|
303
255
|
|
|
304
|
-
```toml
|
|
256
|
+
```toml title="bunfig.toml" icon="settings"
|
|
305
257
|
[test]
|
|
306
258
|
randomize = true
|
|
307
259
|
seed = 2444615283
|
|
@@ -315,7 +267,7 @@ The `--seed` CLI flag will override this setting when specified.
|
|
|
315
267
|
|
|
316
268
|
Re-run each test file a specified number of times. Default `0` (run once).
|
|
317
269
|
|
|
318
|
-
```toml
|
|
270
|
+
```toml title="bunfig.toml" icon="settings"
|
|
319
271
|
[test]
|
|
320
272
|
rerunEach = 3
|
|
321
273
|
```
|
|
@@ -328,7 +280,7 @@ The `--rerun-each` CLI flag will override this setting when specified.
|
|
|
328
280
|
|
|
329
281
|
Package management is a complex issue; to support a range of use cases, the behavior of `bun install` can be configured under the `[install]` section.
|
|
330
282
|
|
|
331
|
-
```toml
|
|
283
|
+
```toml title="bunfig.toml" icon="settings"
|
|
332
284
|
[install]
|
|
333
285
|
# configuration here
|
|
334
286
|
```
|
|
@@ -337,7 +289,7 @@ Package management is a complex issue; to support a range of use cases, the beha
|
|
|
337
289
|
|
|
338
290
|
Whether to install optional dependencies. Default `true`.
|
|
339
291
|
|
|
340
|
-
```toml
|
|
292
|
+
```toml title="bunfig.toml" icon="settings"
|
|
341
293
|
[install]
|
|
342
294
|
optional = true
|
|
343
295
|
```
|
|
@@ -346,7 +298,7 @@ optional = true
|
|
|
346
298
|
|
|
347
299
|
Whether to install development dependencies. Default `true`.
|
|
348
300
|
|
|
349
|
-
```toml
|
|
301
|
+
```toml title="bunfig.toml" icon="settings"
|
|
350
302
|
[install]
|
|
351
303
|
dev = true
|
|
352
304
|
```
|
|
@@ -355,7 +307,7 @@ dev = true
|
|
|
355
307
|
|
|
356
308
|
Whether to install peer dependencies. Default `true`.
|
|
357
309
|
|
|
358
|
-
```toml
|
|
310
|
+
```toml title="bunfig.toml" icon="settings"
|
|
359
311
|
[install]
|
|
360
312
|
peer = true
|
|
361
313
|
```
|
|
@@ -366,7 +318,7 @@ Whether `bun install` will run in "production mode". Default `false`.
|
|
|
366
318
|
|
|
367
319
|
In production mode, `"devDependencies"` are not installed. You can use `--production` in the CLI to override this setting.
|
|
368
320
|
|
|
369
|
-
```toml
|
|
321
|
+
```toml title="bunfig.toml" icon="settings"
|
|
370
322
|
[install]
|
|
371
323
|
production = false
|
|
372
324
|
```
|
|
@@ -377,7 +329,7 @@ Whether to set an exact version in `package.json`. Default `false`.
|
|
|
377
329
|
|
|
378
330
|
By default Bun uses caret ranges; if the `latest` version of a package is `2.4.1`, the version range in your `package.json` will be `^2.4.1`. This indicates that any version from `2.4.1` up to (but not including) `3.0.0` is acceptable.
|
|
379
331
|
|
|
380
|
-
```toml
|
|
332
|
+
```toml title="bunfig.toml" icon="settings"
|
|
381
333
|
[install]
|
|
382
334
|
exact = false
|
|
383
335
|
```
|
|
@@ -388,80 +340,34 @@ If false, generate a binary `bun.lockb` instead of a text-based `bun.lock` file
|
|
|
388
340
|
|
|
389
341
|
Default `true` (since Bun v1.2).
|
|
390
342
|
|
|
391
|
-
```toml
|
|
343
|
+
```toml title="bunfig.toml" icon="settings"
|
|
392
344
|
[install]
|
|
393
345
|
saveTextLockfile = false
|
|
394
346
|
```
|
|
395
347
|
|
|
396
|
-
<!--
|
|
397
|
-
### `install.prefer`
|
|
398
|
-
|
|
399
|
-
Whether the package manager should prefer offline or online dependency resolution. Default `"online"`.
|
|
400
|
-
|
|
401
|
-
```toml
|
|
402
|
-
[install]
|
|
403
|
-
prefer = "online"
|
|
404
|
-
```
|
|
405
|
-
|
|
406
|
-
Valid values are:
|
|
407
|
-
|
|
408
|
-
{% table %}
|
|
409
|
-
|
|
410
|
-
---
|
|
411
|
-
|
|
412
|
-
- `"online"`
|
|
413
|
-
- Prefer online resolution. This is the default. If a package is not found in the local cache, it will be downloaded from the registry.
|
|
414
|
-
|
|
415
|
-
---
|
|
416
|
-
|
|
417
|
-
- `"offline"`
|
|
418
|
-
- Prefer offline resolution. When possible, packages will be installed from the global cache. This minimizes the fraction of the time Bun will check for newer versions from the registry. If a package is not found in the global cache, it will be downloaded from the registry.
|
|
419
|
-
|
|
420
|
-
{% /table %} -->
|
|
421
|
-
|
|
422
348
|
### `install.auto`
|
|
423
349
|
|
|
424
350
|
To configure Bun's package auto-install behavior. Default `"auto"` — when no `node_modules` folder is found, Bun will automatically install dependencies on the fly during execution.
|
|
425
351
|
|
|
426
|
-
```toml
|
|
352
|
+
```toml title="bunfig.toml" icon="settings"
|
|
427
353
|
[install]
|
|
428
354
|
auto = "auto"
|
|
429
355
|
```
|
|
430
356
|
|
|
431
357
|
Valid values are:
|
|
432
358
|
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
-
|
|
436
|
-
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
- `"auto"`
|
|
441
|
-
- Resolve modules from local `node_modules` if it exists. Otherwise, auto-install dependencies on the fly.
|
|
442
|
-
|
|
443
|
-
---
|
|
444
|
-
|
|
445
|
-
- `"force"`
|
|
446
|
-
- Always auto-install dependencies, even if `node_modules` exists.
|
|
447
|
-
|
|
448
|
-
---
|
|
449
|
-
|
|
450
|
-
- `"disable"`
|
|
451
|
-
- Never auto-install dependencies.
|
|
452
|
-
|
|
453
|
-
---
|
|
454
|
-
|
|
455
|
-
- `"fallback"`
|
|
456
|
-
- Check local `node_modules` first, then auto-install any packages that aren't found. You can enable this from the CLI with `bun -i`.
|
|
457
|
-
|
|
458
|
-
{% /table %}
|
|
359
|
+
| Value | Description |
|
|
360
|
+
| ------------ | ----------------------------------------------------------------------------------------------------------------------------------- |
|
|
361
|
+
| `"auto"` | Resolve modules from local `node_modules` if it exists. Otherwise, auto-install dependencies on the fly. |
|
|
362
|
+
| `"force"` | Always auto-install dependencies, even if `node_modules` exists. |
|
|
363
|
+
| `"disable"` | Never auto-install dependencies. |
|
|
364
|
+
| `"fallback"` | Check local `node_modules` first, then auto-install any packages that aren't found. You can enable this from the CLI with `bun -i`. |
|
|
459
365
|
|
|
460
366
|
### `install.frozenLockfile`
|
|
461
367
|
|
|
462
368
|
When true, `bun install` will not update `bun.lock`. Default `false`. If `package.json` and the existing `bun.lock` are not in agreement, this will error.
|
|
463
369
|
|
|
464
|
-
```toml
|
|
370
|
+
```toml title="bunfig.toml" icon="settings"
|
|
465
371
|
[install]
|
|
466
372
|
frozenLockfile = false
|
|
467
373
|
```
|
|
@@ -470,7 +376,7 @@ frozenLockfile = false
|
|
|
470
376
|
|
|
471
377
|
Whether `bun install` will actually install dependencies. Default `false`. When true, it's equivalent to setting `--dry-run` on all `bun install` commands.
|
|
472
378
|
|
|
473
|
-
```toml
|
|
379
|
+
```toml title="bunfig.toml" icon="settings"
|
|
474
380
|
[install]
|
|
475
381
|
dryRun = false
|
|
476
382
|
```
|
|
@@ -481,7 +387,7 @@ To configure the directory where Bun puts globally installed packages.
|
|
|
481
387
|
|
|
482
388
|
Environment variable: `BUN_INSTALL_GLOBAL_DIR`
|
|
483
389
|
|
|
484
|
-
```toml
|
|
390
|
+
```toml title="bunfig.toml" icon="settings"
|
|
485
391
|
[install]
|
|
486
392
|
# where `bun install --global` installs packages
|
|
487
393
|
globalDir = "~/.bun/install/global"
|
|
@@ -493,7 +399,7 @@ To configure the directory where Bun installs globally installed binaries and CL
|
|
|
493
399
|
|
|
494
400
|
Environment variable: `BUN_INSTALL_BIN`
|
|
495
401
|
|
|
496
|
-
```toml
|
|
402
|
+
```toml title="bunfig.toml" icon="settings"
|
|
497
403
|
# where globally-installed package bins are linked
|
|
498
404
|
globalBinDir = "~/.bun/bin"
|
|
499
405
|
```
|
|
@@ -502,7 +408,7 @@ globalBinDir = "~/.bun/bin"
|
|
|
502
408
|
|
|
503
409
|
The default registry is `https://registry.npmjs.org/`. This can be globally configured in `bunfig.toml`:
|
|
504
410
|
|
|
505
|
-
```toml
|
|
411
|
+
```toml title="bunfig.toml" icon="settings"
|
|
506
412
|
[install]
|
|
507
413
|
# set default registry as a string
|
|
508
414
|
registry = "https://registry.npmjs.org"
|
|
@@ -518,7 +424,7 @@ To configure how workspace packages are linked, use the `install.linkWorkspacePa
|
|
|
518
424
|
|
|
519
425
|
Whether to link workspace packages from the monorepo root to their respective `node_modules` directories. Default `true`.
|
|
520
426
|
|
|
521
|
-
```toml
|
|
427
|
+
```toml title="bunfig.toml" icon="settings"
|
|
522
428
|
[install]
|
|
523
429
|
linkWorkspacePackages = true
|
|
524
430
|
```
|
|
@@ -527,7 +433,7 @@ linkWorkspacePackages = true
|
|
|
527
433
|
|
|
528
434
|
To configure a registry for a particular scope (e.g. `@myorg/<package>`) use `install.scopes`. You can reference environment variables with `$variable` notation.
|
|
529
435
|
|
|
530
|
-
```toml
|
|
436
|
+
```toml title="bunfig.toml" icon="settings"
|
|
531
437
|
[install.scopes]
|
|
532
438
|
# registry as string
|
|
533
439
|
myorg = "https://username:password@registry.myorg.com/"
|
|
@@ -544,7 +450,7 @@ myorg = { token = "$npm_token", url = "https://registry.myorg.com/" }
|
|
|
544
450
|
|
|
545
451
|
To configure a CA certificate, use `install.ca` or `install.cafile` to specify a path to a CA certificate file.
|
|
546
452
|
|
|
547
|
-
```toml
|
|
453
|
+
```toml title="bunfig.toml" icon="settings"
|
|
548
454
|
[install]
|
|
549
455
|
# The CA certificate as a string
|
|
550
456
|
ca = "-----BEGIN CERTIFICATE-----\n...\n-----END CERTIFICATE-----"
|
|
@@ -557,7 +463,7 @@ cafile = "path/to/cafile"
|
|
|
557
463
|
|
|
558
464
|
To configure the cache behavior:
|
|
559
465
|
|
|
560
|
-
```toml
|
|
466
|
+
```toml title="bunfig.toml" icon="settings"
|
|
561
467
|
[install.cache]
|
|
562
468
|
|
|
563
469
|
# the directory to use for the cache
|
|
@@ -577,92 +483,37 @@ To configure lockfile behavior, use the `install.lockfile` section.
|
|
|
577
483
|
|
|
578
484
|
Whether to generate a lockfile on `bun install`. Default `true`.
|
|
579
485
|
|
|
580
|
-
```toml
|
|
486
|
+
```toml title="bunfig.toml" icon="settings"
|
|
581
487
|
[install.lockfile]
|
|
582
488
|
save = true
|
|
583
489
|
```
|
|
584
490
|
|
|
585
491
|
Whether to generate a non-Bun lockfile alongside `bun.lock`. (A `bun.lock` will always be created.) Currently `"yarn"` is the only supported value.
|
|
586
492
|
|
|
587
|
-
```toml
|
|
493
|
+
```toml title="bunfig.toml" icon="settings"
|
|
588
494
|
[install.lockfile]
|
|
589
495
|
print = "yarn"
|
|
590
496
|
```
|
|
591
497
|
|
|
592
|
-
### `install.security.scanner`
|
|
593
|
-
|
|
594
|
-
Configure a security scanner to scan packages for vulnerabilities before installation.
|
|
595
|
-
|
|
596
|
-
First, install a security scanner from npm:
|
|
597
|
-
|
|
598
|
-
```bash
|
|
599
|
-
$ bun add -d @acme/bun-security-scanner
|
|
600
|
-
```
|
|
601
|
-
|
|
602
|
-
Then configure it in your `bunfig.toml`:
|
|
603
|
-
|
|
604
|
-
```toml
|
|
605
|
-
[install.security]
|
|
606
|
-
scanner = "@acme/bun-security-scanner"
|
|
607
|
-
```
|
|
608
|
-
|
|
609
|
-
When a security scanner is configured:
|
|
610
|
-
|
|
611
|
-
- Auto-install is automatically disabled for security
|
|
612
|
-
- Packages are scanned before installation
|
|
613
|
-
- Installation is cancelled if fatal issues are found
|
|
614
|
-
- Security warnings are displayed during installation
|
|
615
|
-
|
|
616
|
-
Learn more about [using and writing security scanners](/docs/install/security-scanner-api).
|
|
617
|
-
|
|
618
498
|
### `install.linker`
|
|
619
499
|
|
|
620
|
-
Configure the default linker strategy. Default `"hoisted"
|
|
500
|
+
Configure the default linker strategy. Default `"hoisted"` for single-project projects, `"isolated"` for monorepo projects.
|
|
621
501
|
|
|
622
|
-
For complete documentation refer to [Package manager > Isolated installs](
|
|
502
|
+
For complete documentation refer to [Package manager > Isolated installs](/pm/isolated-installs).
|
|
623
503
|
|
|
624
|
-
```toml
|
|
504
|
+
```toml title="bunfig.toml" icon="settings"
|
|
625
505
|
[install]
|
|
626
506
|
linker = "hoisted"
|
|
627
507
|
```
|
|
628
508
|
|
|
629
509
|
Valid values are:
|
|
630
510
|
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
---
|
|
637
|
-
|
|
638
|
-
- `"hoisted"`
|
|
639
|
-
- Link dependencies in a shared `node_modules` directory.
|
|
640
|
-
|
|
641
|
-
---
|
|
642
|
-
|
|
643
|
-
- `"isolated"`
|
|
644
|
-
- Link dependencies inside each package installation.
|
|
645
|
-
|
|
646
|
-
{% /table %}
|
|
647
|
-
|
|
648
|
-
### `install.minimumReleaseAge`
|
|
649
|
-
|
|
650
|
-
Configure a minimum age (in seconds) for npm package versions. Package versions published more recently than this threshold will be filtered out during installation. Default is `null` (disabled).
|
|
511
|
+
| Value | Description |
|
|
512
|
+
| ------------ | ------------------------------------------------------- |
|
|
513
|
+
| `"hoisted"` | Link dependencies in a shared `node_modules` directory. |
|
|
514
|
+
| `"isolated"` | Link dependencies inside each package installation. |
|
|
651
515
|
|
|
652
|
-
```toml
|
|
653
|
-
[install]
|
|
654
|
-
# Only install package versions published at least 3 days ago
|
|
655
|
-
minimumReleaseAge = 259200
|
|
656
|
-
# These packages will bypass the 3-day minimum age requirement
|
|
657
|
-
minimumReleaseAgeExcludes = ["@types/bun", "typescript"]
|
|
658
|
-
```
|
|
659
|
-
|
|
660
|
-
For more details see [Minimum release age](https://bun.com/docs/cli/install#minimum-release-age) in the install documentation.
|
|
661
|
-
|
|
662
|
-
<!-- ## Debugging -->
|
|
663
|
-
|
|
664
|
-
<!--
|
|
665
|
-
```toml
|
|
516
|
+
```toml title="bunfig.toml" icon="settings"
|
|
666
517
|
[debug]
|
|
667
518
|
# When navigating to a blob: or src: link, open the file in your editor
|
|
668
519
|
# If not, it tries $EDITOR or $VISUAL
|
|
@@ -680,13 +531,26 @@ editor = "code"
|
|
|
680
531
|
# - "vim","vi"
|
|
681
532
|
# - "emacs"
|
|
682
533
|
```
|
|
683
|
-
|
|
534
|
+
|
|
535
|
+
### `install.minimumReleaseAge`
|
|
536
|
+
|
|
537
|
+
Configure a minimum age (in seconds) for npm package versions. Package versions published more recently than this threshold will be filtered out during installation. Default is `null` (disabled).
|
|
538
|
+
|
|
539
|
+
```toml title="bunfig.toml" icon="settings"
|
|
540
|
+
[install]
|
|
541
|
+
# Only install package versions published at least 3 days ago
|
|
542
|
+
minimumReleaseAge = 259200
|
|
543
|
+
# These packages will bypass the 3-day minimum age requirement
|
|
544
|
+
minimumReleaseAgeExcludes = ["@types/bun", "typescript"]
|
|
545
|
+
```
|
|
546
|
+
|
|
547
|
+
For more details see [Minimum release age](/pm/cli/install#minimum-release-age) in the install documentation.
|
|
684
548
|
|
|
685
549
|
## `bun run`
|
|
686
550
|
|
|
687
551
|
The `bun run` command can be configured under the `[run]` section. These apply to the `bun run` command and the `bun` command when running a file or executable or script.
|
|
688
552
|
|
|
689
|
-
Currently, `bunfig.toml`
|
|
553
|
+
Currently, `bunfig.toml` isn't always automatically loaded for `bun run` in a local project (it does check for a global `bunfig.toml`), so you might still need to pass `-c` or `-c=bunfig.toml` to use these settings.
|
|
690
554
|
|
|
691
555
|
### `run.shell` - use the system shell or Bun's shell
|
|
692
556
|
|
|
@@ -694,7 +558,7 @@ The shell to use when running package.json scripts via `bun run` or `bun`. On Wi
|
|
|
694
558
|
|
|
695
559
|
To always use the system shell instead of Bun's shell (default behavior unless Windows):
|
|
696
560
|
|
|
697
|
-
```toml
|
|
561
|
+
```toml title="bunfig.toml" icon="settings"
|
|
698
562
|
[run]
|
|
699
563
|
# default outside of Windows
|
|
700
564
|
shell = "system"
|
|
@@ -702,7 +566,7 @@ shell = "system"
|
|
|
702
566
|
|
|
703
567
|
To always use Bun's shell instead of the system shell:
|
|
704
568
|
|
|
705
|
-
```toml
|
|
569
|
+
```toml title="bunfig.toml" icon="settings"
|
|
706
570
|
[run]
|
|
707
571
|
# default on Windows
|
|
708
572
|
shell = "bun"
|
|
@@ -716,7 +580,7 @@ This means that if you have a script that runs `node`, it will actually run `bun
|
|
|
716
580
|
|
|
717
581
|
By default, this is enabled if `node` is not already in your `$PATH`.
|
|
718
582
|
|
|
719
|
-
```toml
|
|
583
|
+
```toml title="bunfig.toml" icon="settings"
|
|
720
584
|
[run]
|
|
721
585
|
# equivalent to `bun --bun` for all `bun run` commands
|
|
722
586
|
bun = true
|
|
@@ -725,8 +589,8 @@ bun = true
|
|
|
725
589
|
You can test this by running:
|
|
726
590
|
|
|
727
591
|
```sh
|
|
728
|
-
|
|
729
|
-
|
|
592
|
+
bun --bun which node # /path/to/bun
|
|
593
|
+
bun which node # /path/to/node
|
|
730
594
|
```
|
|
731
595
|
|
|
732
596
|
This option is equivalent to prefixing all `bun run` commands with `--bun`:
|
|
@@ -743,23 +607,29 @@ If set to `false`, this will disable the `node` symlink.
|
|
|
743
607
|
|
|
744
608
|
When `true`, suppresses the output of the command being run by `bun run` or `bun`.
|
|
745
609
|
|
|
746
|
-
```toml
|
|
610
|
+
```toml title="bunfig.toml" icon="settings"
|
|
747
611
|
[run]
|
|
748
612
|
silent = true
|
|
749
613
|
```
|
|
750
614
|
|
|
751
615
|
Without this option, the command being run will be printed to the console:
|
|
752
616
|
|
|
753
|
-
```sh
|
|
754
|
-
|
|
755
|
-
|
|
617
|
+
```sh terminal icon="terminal"
|
|
618
|
+
bun run dev
|
|
619
|
+
echo "Running \"dev\"..."
|
|
620
|
+
```
|
|
621
|
+
|
|
622
|
+
```txt
|
|
756
623
|
Running "dev"...
|
|
757
624
|
```
|
|
758
625
|
|
|
759
626
|
With this option, the command being run will not be printed to the console:
|
|
760
627
|
|
|
761
628
|
```sh
|
|
762
|
-
|
|
629
|
+
bun run dev
|
|
630
|
+
```
|
|
631
|
+
|
|
632
|
+
```txt
|
|
763
633
|
Running "dev"...
|
|
764
634
|
```
|
|
765
635
|
|