Bun

Bun API Reference

This is the complete API reference for Bun, documenting all available APIs, types, and functions. Use the sidebar navigation to browse modules and specific APIs, which are color-coded by type.

This documentation is generated from Bun's TypeScript definitions, which you can find in the oven-sh/bun repository under packages/bun-types.

Bun

Core runtime APIs for file system, networking, processes, and more.

View documentation →
bun:ffi

Foreign Function Interface for calling native C functions from JavaScript.

View documentation →
bun:jsc

Low-level JavaScript Core engine APIs for advanced use cases.

View documentation →
bun:sqlite

Built-in SQLite database integration with a simple, performant API.

View documentation →
bun:test

Testing utilities for writing unit and integration tests.

View documentation →
Globals

Variables and classes that exist in Bun's global scope

View documentation →
node:assert

APIs for the node:assert module.

View documentation →
node:async_hooks

APIs for the node:async_hooks module.

View documentation →
node:buffer

APIs for the node:buffer module.

View documentation →
node:child_process

APIs for the node:child_process module.

View documentation →
node:cluster

APIs for the node:cluster module.

View documentation →
node:crypto

APIs for the node:crypto module.

View documentation →
node:dgram

APIs for the node:dgram module.

View documentation →
node:diagnostics_channel

APIs for the node:diagnostics_channel module.

View documentation →
node:dns

APIs for the node:dns module.

View documentation →
node:dns/promises

APIs for the node:dns/promises module.

View documentation →
node:events

APIs for the node:events module.

View documentation →
node:fs

APIs for the node:fs module.

View documentation →
node:fs/promises

APIs for the node:fs/promises module.

View documentation →
node:http

APIs for the node:http module.

View documentation →
node:http2

APIs for the node:http2 module.

View documentation →
node:https

APIs for the node:https module.

View documentation →
node:module

APIs for the node:module module.

View documentation →
node:net

APIs for the node:net module.

View documentation →
node:os

APIs for the node:os module.

View documentation →
node:path

APIs for the node:path module.

View documentation →
node:perf_hooks

APIs for the node:perf_hooks module.

View documentation →
node:punycode

APIs for the node:punycode module.

View documentation →
node:querystring

APIs for the node:querystring module.

View documentation →
node:readline

APIs for the node:readline module.

View documentation →
node:readline/promises

APIs for the node:readline/promises module.

View documentation →
node:stream

APIs for the node:stream module.

View documentation →
node:stream/consumers

APIs for the node:stream/consumers module.

View documentation →
node:stream/promises

APIs for the node:stream/promises module.

View documentation →
node:stream/web

APIs for the node:stream/web module.

View documentation →
node:string_decoder

APIs for the node:string_decoder module.

View documentation →
node:test

APIs for the node:test module.

View documentation →
node:test/reporters

APIs for the node:test/reporters module.

View documentation →
node:timers/promises

APIs for the node:timers/promises module.

View documentation →
node:tls

APIs for the node:tls module.

View documentation →
node:trace_events

APIs for the node:trace_events module.

View documentation →
node:tty

APIs for the node:tty module.

View documentation →
node:url

APIs for the node:url module.

View documentation →
node:util

APIs for the node:util module.

View documentation →
node:util/types

APIs for the node:util/types module.

View documentation →
node:v8

APIs for the node:v8 module.

View documentation →
node:vm

APIs for the node:vm module.

View documentation →
node:wasi

APIs for the node:wasi module.

View documentation →
node:worker_threads

APIs for the node:worker_threads module.

View documentation →
node:zlib

APIs for the node:zlib module.

View documentation →