Skip to main content
Overview
Deployment
Runtime & Debugging
Utilities
Ecosystem & Frameworks
- Astro with Bun
- Discord.js with Bun
- Docker with Bun
- Drizzle with Bun
- Gel with Bun
- Elysia with Bun
- Express with Bun
- Hono with Bun
- Mongoose with Bun
- Neon Drizzle with Bun
- Neon Serverless Postgres with Bun
- Next.js with Bun
- Nuxt with Bun
- PM2 with Bun
- Prisma ORM with Bun
- Prisma Postgres with Bun
- Qwik with Bun
- React with Bun
- Remix with Bun
- TanStack Start with Bun
- Sentry with Bun
- SolidStart with Bun
- SSR React with Bun
- StricJS with Bun
- SvelteKit with Bun
- systemd with Bun
- Vite with Bun
- Upstash with Bun
HTTP & Networking
- HTTP Server with Bun
- Simple HTTP Server with Bun
- Fetch with Bun
- Hot reload an HTTP server
- Start a cluster of HTTP servers
- Configure TLS
- Proxy HTTP requests using fetch()
- Stream file response
- Upload files via HTTP using FormData
- Fetch with unix domain sockets
- Stream with iterators
- Server-Sent Events
- Stream with Node.js
Processes & System
Package Manager
- Add a dependency
- Add a dev dependency
- Add an optional dependency
- Add a peer dependency
- Add a Git dependency
- Add a tarball dependency
- Install with alias
- Workspaces with Bun
- Override the default npm registry
- Configure a scoped registry
- Azure Artifacts with Bun
- JFrog Artifactory with Bun
- Add a trusted dependency
- Generate a yarn-compatible lockfile
- Migrate from npm to bun
- Configure git to diff Bun's lockfile
- Install Bun in GitHub Actions
Test Runner
Runtime & Debugging
Module System
File System
- Read as string
- Read to Buffer
- Read to Uint8Array
- Read to ArrayBuffer
- Read JSON file
- Get MIME type
- Check file exists
- Watch directory
- Read as stream
- Write string to file
- Write Blob
- Write Response
- Append to file
- Incremental write
- Write stream
- Write to stdout
- Write file to stdout
- Copy file
- Delete file
- Delete files
- Delete directories
Utilities
HTML Processing
Binary Data
- ArrayBuffer to string
- ArrayBuffer to Buffer
- ArrayBuffer to Blob
- ArrayBuffer to Array
- ArrayBuffer to Uint8Array
- Buffer to string
- Buffer to ArrayBuffer
- Buffer to Blob
- Buffer to Uint8Array
- Buffer to ReadableStream
- Blob to string
- Blob to ArrayBuffer
- Blob to Uint8Array
- Blob to DataView
- Blob to ReadableStream
- Uint8Array to string
- Uint8Array to ArrayBuffer
- Uint8Array to Buffer
- Uint8Array to Blob
- Uint8Array to DataView
- Uint8Array to ReadableStream
- DataView to string
Utilities
Check if two objects are deeply equal
Check if two objects are deeply equal. This is used internally by
index.ts
Pass
index.ts
See Docs > API > Utils for more useful utilities.
expect().toEqual() in Bun’s test runner.
const a = { a: 1, b: 2, c: { d: 3 } };
const b = { a: 1, b: 2, c: { d: 3 } };
Bun.deepEquals(a, b); // true
Pass
true as a third argument to enable strict mode. This is used internally by expect().toStrictEqual() in Bun’s test runner.
The following examples would return true in non-strict mode but false in strict mode.
// undefined values
Bun.deepEquals({}, { a: undefined }, true); // false
// undefined in arrays
Bun.deepEquals(["asdf"], ["asdf", undefined], true); // false
// sparse arrays
Bun.deepEquals([, 1], [undefined, 1], true); // false
// object literals vs instances w/ same properties
class Foo {
a = 1;
}
Bun.deepEquals(new Foo(), { a: 1 }, true); // false
See Docs > API > Utils for more useful utilities.
Was this page helpful?
⌘I
