Skip to content

Some Web APIs aren't relevant in the context of a server-first runtime like Bun, such as the DOM API or History API. Many others, though, are broadly useful outside of the browser context; when possible, Bun implements these Web-standard APIs instead of introducing new APIs.

The following Web APIs are partially or completely supported.

CategoryAPIs
HTTPfetch, Response, Request, Headers, AbortController, AbortSignal
URLsURL, URLSearchParams
Web WorkersWorker, self.postMessage, structuredClone, MessagePort, MessageChannel, BroadcastChannel
StreamsReadableStream, WritableStream, TransformStream, ByteLengthQueuingStrategy, CountQueuingStrategy and associated classes
BlobBlob
WebSocketsWebSocket
Encoding and decodingatob, btoa, TextEncoder, TextDecoder
JSONJSON
TimeoutssetTimeout, clearTimeout
IntervalssetInterval, clearInterval
Cryptocrypto, SubtleCrypto, CryptoKey
Debuggingconsole, performance
MicrotasksqueueMicrotask
ErrorsreportError
User interactionalert, confirm, prompt (intended for interactive CLIs)
RealmsShadowRealm
EventsEventTarget, Event, ErrorEvent, CloseEvent, MessageEvent

Released under the MIT License.