Documentation Index

Fetch the complete documentation index at: /docs/llms.txt

Use this file to discover all available pages before exploring further.

Skip to main content
Check process.versions.bun to detect whether code is running in Bun. This works in both JavaScript and TypeScript without extra type definitions.
if (process.versions.bun) {
  // this code will only run when the file is run with Bun
}

Alternatively, check for the Bun global, the same way you’d check for window to detect a browser.
In TypeScript, this is a type error unless @types/bun is installed. Install it with bun add -d @types/bun.
if (typeof Bun !== "undefined") {
  // this code will only run when the file is run with Bun
}
Morty Proxy This is a proxified and sanitized view of the page, visit original site.