Bun llms.txt · AI Docs Browser · mdream

[llms.txt Tools](https://mdream.dev/llms-txt/bun/llms-txt)

# Bun llms.txt

Browse Bun documentation as markdown. Click any page in the sidebar to view it, or copy the full llms.txt for your AI tools.

bun.sh/llms.txt

[Raw llms.txt](https://bun.sh/llms.txt) [Raw llms-full.txt](https://bun.sh/llms-full.txt)

Copy Markdown [](https://bun.sh/llms.txt)

llms.txt

Docs

Bytecode Caching

CSS

esbuild

Single-file executable

Fullstack dev server

Hot reloading

HTML & static sites

Bundler

Loaders

Macros

Minifier

Plugins

Standalone HTML

Feedback

Convert an ArrayBuffer to an array of numbers

Convert an ArrayBuffer to a Blob

Convert an ArrayBuffer to a Buffer

Convert an ArrayBuffer to a string

Convert an ArrayBuffer to a Uint8Array

Convert a Blob to an ArrayBuffer

Convert a Blob to a DataView

Convert a Blob to a ReadableStream

Convert a Blob to a string

Convert a Blob to a Uint8Array

Convert a Buffer to an ArrayBuffer

Convert a Buffer to a blob

Convert a Buffer to a ReadableStream

Convert a Buffer to a string

Convert a Buffer to a Uint8Array

Convert a DataView to a string

Convert a Uint8Array to an ArrayBuffer

Convert a Uint8Array to a Blob

Convert a Uint8Array to a Buffer

Convert a Uint8Array to a DataView

Convert a Uint8Array to a ReadableStream

Convert a Uint8Array to a string

Deploy a Bun application on AWS Lambda

Deploy a Bun application on DigitalOcean

Deploy a Bun application on Google Cloud Run

Deploy a Bun application on Railway

Deploy a Bun application on Render

Deploy a Bun application on Vercel

Build an app with Astro and Bun

Create a Discord bot

Containerize a Bun application with Docker

Use Drizzle ORM with Bun

Build an HTTP server using Elysia and Bun

Build an HTTP server using Express and Bun

Use Gel with Bun

Build an HTTP server using Hono and Bun

Read and write data to MongoDB using Mongoose and Bun

Use Neon Postgres through Drizzle ORM

Use Neon's Serverless Postgres with Bun

Build an app with Next.js and Bun

Build an app with Nuxt and Bun

Run Bun as a daemon with PM2

Use Prisma with Bun

Use Prisma Postgres with Bun

Build an app with Qwik and Bun

Build a React app with Bun

Build an app with Remix and Bun

Add Sentry to a Bun app

Build an app with SolidStart and Bun

Server-side render (SSR) a React component

Build an HTTP server using StricJS and Bun

Build an app with SvelteKit and Bun

Run Bun as a daemon with systemd

Use TanStack Start with Bun

Bun Redis with Upstash

Build a frontend using Vite and Bun

Extract links from a webpage using HTMLRewriter

Extract social share images and Open Graph tags

Start a cluster of HTTP servers

Send an HTTP request using fetch

fetch with unix domain sockets in Bun

Upload files via HTTP using FormData

Hot reload an HTTP server

Proxy HTTP requests using fetch()

Common HTTP server usage

Write a simple HTTP server

Server-Sent Events (SSE) with Bun

Stream a file as an HTTP Response

Streaming HTTP Server with Async Iterators

Streaming HTTP Server with Node.js Streams

Configure TLS on an HTTP server

Guides

Add a dependency

Add a development dependency

Add a Git dependency

Add an optional dependency

Add a peer dependency

Add a tarball dependency

Using bun install with an Azure Artifacts npm registry

Install dependencies with Bun in GitHub Actions

Override the default npm registry for bun install

Migrate from npm install to bun install

Configure git to diff Bun's lockb lockfile

Using bun install with Artifactory

Install a package under a different name

Configure a private registry for an organization scope with bun install

Add a trusted dependency

Configuring a monorepo using workspaces

Generate a yarn-compatible lockfile

Parse command-line arguments

Listen for CTRL+C

Spawn a child process and communicate using IPC

Get the process uptime in nanoseconds

Listen to OS signals

Spawn a child process

Read stderr from a child process

Read stdout from a child process

Read from stdin

Read a file to an ArrayBuffer

Read a file to a Buffer

Check if a file exists

Read a JSON file

Get the MIME type of a file

Read a file as a ReadableStream

Read a file as a string

Read a file to a Uint8Array

Watch a directory for changes

Build-time constants with --define

Install and run Bun in GitHub Actions

Codesign a single-file JavaScript executable on macOS

Define and replace static globals & constants

Delete directories

Delete files

Inspect memory usage using V8 heap snapshots

Import a HTML file as text

Import a JSON file

Import a JSON5 file

Import a TOML file

Import a YAML file

Read environment variables

Set environment variables

Run a Shell Command

Set a time zone in Bun

Re-map import paths

Install TypeScript declarations for Bun

Debugging Bun with the VS Code extension

Debugging Bun with the web debugger

Convert a Node.js Readable to an ArrayBuffer

Convert a Node.js Readable to a Blob

Convert a Node.js Readable to JSON

Convert a Node.js Readable to a string

Convert a Node.js Readable to an Uint8Array

Convert a ReadableStream to an array of chunks

Convert a ReadableStream to an ArrayBuffer

Convert a ReadableStream to a Blob

Convert a ReadableStream to a Buffer

Convert a ReadableStream to JSON

Convert a ReadableStream to a string

Convert a ReadableStream to a Uint8Array

Bail early with the Bun test runner

Selectively run tests concurrently with glob patterns

Generate code coverage reports with the Bun test runner

Set a code coverage threshold with the Bun test runner

Write browser DOM tests with Bun and happy-dom

Migrate from Jest to Bun's test runner

Set the system time in Bun's test runner

Mock functions in bun test

Re-run tests multiple times with the Bun test runner

Run your tests with the Bun test runner

Skip tests with the Bun test runner

Use snapshot testing in bun test

Spy on methods in bun test

import, require, and test Svelte components with bun test

Using Testing Library with Bun

Set a per-test timeout with the Bun test runner

Mark a test as a "todo" with the Bun test runner

Update snapshots in bun test

Run tests in watch mode with Bun

Encode and decode base64 data

Check if two objects are deeply equal

Compress and decompress data with DEFLATE

Detect when code is executed with Bun

Check if the current file is the entrypoint

Escape an HTML string

Convert a file URL to an absolute path

Compress and decompress data with gzip

Hash a password

Get the directory of the current file

Get the file name of the current file

Get the absolute path of the current file

Generate a UUID

Get the absolute path to the current entrypoint

Convert an absolute path to a file URL

Sleep for a fixed number of milliseconds

Upgrade Bun to the latest version

Get the current Bun version

Get the path to an executable bin file

Enable compression for WebSocket messages

Set per-socket contextual data on a WebSocket

Build a publish-subscribe WebSocket server

Build a simple WebSocket server

Append content to a file

Write a string to a file

Write a Blob to a file

Write a file to stdout

Copy a file to another location

Write a file incrementally

Write a Response to a file

Write to stdout

Write a ReadableStream to a file

Delete a file

Welcome to Bun

Installation

bunx

Catalogs

bun add

bun audit

bun info

bun install

bun link

bun outdated

bun patch

bun pm

bun publish

bun remove

bun update

bun why

bun --filter

Global cache

Global virtual store

Isolated installs

Lifecycle scripts

Lockfile

.npmrc support

Overrides and resolutions

Scopes and registries

Security Scanner API

Workspaces

Benchmarking

Bindgen

Building Windows

Contributing

License

Roadmap

Quickstart

Archive

Auto-install

Binary Data

Bun APIs

bunfig.toml

C Compiler

Spawn

Color

Console

Cookies

Cron

CSRF Protection

Debugging

Environment Variables

FFI

File I/O

File System Router

File Types

Glob

Globals

Hashing

HTMLRewriter

Cookies

Error Handling

Metrics

Routing

Server

TLS

WebSockets

Image

Bun Runtime

JSON5

JSONL

JSX

Markdown

Module Resolution

DNS

Fetch

TCP

UDP

Node-API

Node.js Compatibility

Plugins

Redis

REPL

S3

Secrets

Semver

Shell

SQL

SQLite

Streams

bun create

bun init

TOML

Transpiler

Utils

Watch Mode

Web APIs

WebView

Workers

YAML

Code coverage

Test configuration

Dates and times

Finding tests

DOM testing

Test runner

Lifecycle hooks

Mocks

Test Reporters

Runtime behavior

Snapshots

Writing tests

TypeScript

TypeScript 6 and 7

Optional

Reference

Blog

## What is Bun's llms.txt?

Bun publishes an `/llms.txt` file that provides AI systems with a structured index of its documentation. It follows the [llms.txt specification](https://llmstxt.org), organizing links to guides, API references, and tutorials under section headings so that LLMs like ChatGPT, Claude, and Gemini can quickly understand what Bun offers and where to find details.

Pass

Spec

2

Sections

317

Links

32.3 KB

Size

~8.3k

Tokens

Sections: Docs · Optional

## Add Bun Docs to Your AI Assistant

Select your tool to see how to add Bun's llms.txt as a documentation source.

Cursor

 Windsurf

 Claude Code

 ChatGPT

 Zed

 Copilot

1. 1

   Open any chat or composer panel
2. 2

   Type @Docs and select "Add new doc"
3. 3

   Paste the URL: https://bun.sh/llms.txt
4. 4

   Wait for the green dot (indexing complete)
5. 5

   Reference @Docs in chat when asking about Bun

Cursor crawls the URL and indexes all subpages. Add a trailing slash to index child pages too.

## Spec Compliance 4 notes

## Frequently Asked Questions

Where is Bun's llms.txt file?

Bun publishes its llms.txt at https://bun.sh/llms.txt. This file provides a structured, markdown-formatted index of Bun's documentation that AI systems can consume to understand the project's APIs, guides, and references.

How do I use Bun's llms.txt with AI coding assistants?

Copy the llms.txt content and paste it into your AI assistant (Cursor, Windsurf, Claude, ChatGPT) as context. This gives the AI an accurate map of Bun's documentation so it can provide better code suggestions and answers about Bun.

What does Bun's llms.txt contain?

Bun's llms.txt contains 2 sections and 317 documentation links in 32.3 KB (~8.3k tokens). Key sections include Docs, Optional.

How many tokens does Bun's llms.txt use?

The concise llms.txt index is approximately 8.3k tokens (32.3 KB). Most AI assistants can fit this within their context window. For the full expanded documentation, look for an llms-full.txt variant which embeds all content inline.

What is Bun?

Incredibly fast JavaScript runtime, bundler, and package manager. Bun's llms.txt file helps AI systems understand this by providing a structured overview of its documentation, making it easier for developers to get accurate AI-assisted help when working with Bun.

Can I generate an llms.txt for my own project?

Yes. Use the free llms.txt generator at mdream.dev/tools/llms-txt/generator to crawl your site and produce a spec-compliant llms.txt file. You can also validate existing files with the llms.txt validator.

## Browse More llms.txt Files

[GitHub Docs GitHub documentation](https://mdream.dev/llms-txt/bun/llms-txt/github-docs) [Three.js 3D library for JavaScript](https://mdream.dev/llms-txt/bun/llms-txt/three-js) [Mintlify Beautiful documentation that converts users](https://mdream.dev/llms-txt/bun/llms-txt/mintlify) [TanStack High-quality open-source libraries for web development](https://mdream.dev/llms-txt/bun/llms-txt/tanstack) [Clerk Authentication and user management for developers](https://mdream.dev/llms-txt/bun/llms-txt/clerk) [React The library for web and native user interfaces](https://mdream.dev/llms-txt/bun/llms-txt/react) [Upstash Serverless data platform for Redis and Kafka](https://mdream.dev/llms-txt/bun/llms-txt/upstash) [LangChain Framework for developing applications powered by LLMs](https://mdream.dev/llms-txt/bun/llms-txt/langchain)

[View all 99 projects ](https://mdream.dev/llms-txt/bun/llms-txt)

## Related Tools

[<h3>llms.txt Generator</h3>Generate an llms.txt for your own project.](https://mdream.dev/llms-txt/bun/tools/llms-txt/generator) [<h3>llms.txt Validator</h3>Validate your llms.txt against the official spec.](https://mdream.dev/llms-txt/bun/tools/llms-txt/validator)

© 2026 [Harlan Wilton](https://github.com/harlan-zw) · [MIT](https://github.com/harlan-zw/mdream/blob/main/license)

[GitHub](https://github.com/harlan-zw/mdream) [Discord](https://discord.com/invite/275MBUBvgP)