module
globals
Functions 16
- addEventListener()
- alert()
MDN Reference
- clearImmediate()
Cancel an immediate function call by its immediate ID.
- clearInterval()
MDN Reference
- clearTimeout()
MDN Reference
- confirm()
MDN Reference
- fetch()
MDN Reference
- postMessage()
Posts a message to the given window.
- prompt()
MDN Reference
- queueMicrotask()
MDN Reference
- removeEventListener()
- reportError()
MDN Reference
- setImmediate()
Run a function immediately after main event loop is vacant
- setInterval()
MDN Reference
- setTimeout()
MDN Reference
- structuredClone()
MDN Reference
Classes 53
- class AbortController
A controller object that allows you to abort one or more DOM requests as and when desired.
- class AbortSignal
A signal object that allows you to communicate with a DOM request (such as a Fetch) and abort it if required via an AbortController object.
- class ArrayBuffer
Represents a raw buffer of binary data, which is used to store data for the different typed arrays.
- class Blob
A file-like object of immutable, raw data.
- class BroadcastChannel
MDN Reference
- class ByteLengthQueuingStrategy
This Streams API interface provides a built-in byte length queuing strategy that can be used when constructing streams.
- class CloseEvent
A CloseEvent is sent to clients using WebSockets when the connection is closed.
- class CompressionStream
MDN Reference
- class CountQueuingStrategy
This Streams API interface provides a built-in byte length queuing strategy that can be used when constructing streams.
- class Crypto
Basic cryptography features available in the current context.
- class CryptoKey
The CryptoKey dictionary of the Web Crypto API represents a cryptographic key.
- class CustomEvent
MDN Reference
- class DecompressionStream
MDN Reference
- class DOMException
An abnormal event (called an exception) which occurs as a result of calling a method or accessing a property of a web API.
- class ErrorEvent
Events providing information related to errors in scripts or in files.
- class Event
An event which takes place in the DOM.
- class EventTarget
EventTarget is a DOM interface implemented by objects that can receive events and may have listeners for them.
- class File
Provides information about files and allows JavaScript in a web page to access their content.
- class FormData
Provides a way to easily construct a set of key/value pairs representing form fields and their values, which can then be easily sent using the XMLHttpRequest.send() me…
- class Headers
This Fetch API interface allows you to perform various actions on HTTP request and response headers.
- class MessageChannel
This Channel Messaging API interface allows us to create a new message channel and send data through it via its two MessagePort properties.
- class MessageEvent
A message received by a target object.
- class MessagePort
This Channel Messaging API interface represents one of the two ports of a MessageChannel, allowing messages to be sent from one port and listening out for them arrivin…
- class Navigator
The state and the identity of the user agent.
- class Performance
Provides access to performance-related information for the current page.
- class PerformanceEntry
Encapsulates a single performance metric that is part of the performance timeline.
- class PerformanceMark
PerformanceMark is an abstract interface for PerformanceEntry objects with an entryType of "mark".
- class PerformanceMeasure
PerformanceMeasure is an abstract interface for PerformanceEntry objects with an entryType of "measure".
- class PerformanceObserver
MDN Reference
- class PerformanceObserverEntryList
MDN Reference
- class PerformanceResourceTiming
Enables retrieval and analysis of detailed network timing data regarding the loading of an application's resources.
- class ReadableByteStreamController
MDN Reference
- class ReadableStream
This Streams API interface represents a readable stream of byte data.
- class ReadableStreamBYOBReader
MDN Reference
- class ReadableStreamBYOBRequest
MDN Reference
- class ReadableStreamDefaultController
MDN Reference
- class ReadableStreamDefaultReader
MDN Reference
- class Request
This Fetch API interface represents a resource request.
- class Response
This Fetch API interface represents the response to a request.
- class ShadowRealm
ShadowRealms are a distinct global environment, with its own global object containing its own intrinsics and built-ins (standard objects that are not bound to global v…
- class SubtleCrypto
This Web Crypto API interface provides a number of low-level cryptographic functions.
- class TextDecoder
A decoder for a specific method, that is a specific character encoding, like utf-8, iso-8859-2, koi8, cp1261, gbk, etc.
- class TextDecoderStream
MDN Reference
- class TextEncoder
TextEncoder takes a stream of code points as input and emits a stream of bytes.
- class TextEncoderStream
MDN Reference
- class TransformStream
MDN Reference
- class TransformStreamDefaultController
MDN Reference
- class Uint8Array
A typed array of 8-bit unsigned integer values.
- class URL
The URL interface represents an object providing static methods used for creating object URLs.
- class URLSearchParams
MDN Reference
- class WritableStream
This Streams API interface provides a standard abstraction for writing streaming data to a destination, known as a sink.
- class WritableStreamDefaultController
This Streams API interface represents a controller allowing control of a WritableStream's state.
- class WritableStreamDefaultWriter
This Streams API interface is the object returned by WritableStream.getWriter() and once created locks the < writer to the WritableStream ensuring that no other stream…
Interfaces 44
- interface AddEventListenerOptions
- interface ArrayBufferConstructor
- interface ArrayConstructor
- interface BlobPropertyBag
- interface BunFetchRequestInit
BunFetchRequestInit represents additional options that Bun supports in
fetch()only. - interface BunFetchRequestInitTLS
Extends Bun.TLSOptions with extra properties that are only supported in
fetch(url, {tls: ...}) - interface Console
MDN Reference
- interface ConsoleOptions
- interface CryptoKeyPair
- interface Dict
- interface ErrnoException
- interface Error
- interface ErrorConstructor
- interface ErrorOptions
- interface EventListener
- interface EventListenerObject
- interface EventMap
- interface EventSource
MDN Reference
- interface EventSourceInit
- interface FetchEvent
An event which takes place in the DOM.
- interface ImportMeta
The type of
import.meta. - interface ImportMetaEnv
- interface Position
- interface PromiseConstructor
Represents the completion of an asynchronous operation
- interface QueuingStrategy
- interface QueuingStrategyInit
- interface QueuingStrategySize
- interface ReadableStreamDefaultReadDoneResult
- interface ReadableStreamDefaultReadValueResult
- interface ReadableStreamDirectController
- interface ReadableStreamGenericReader
- interface ReadableWritablePair
- interface ReadOnlyDict
- interface RegExpConstructor
- interface RequestInit
- interface ResponseInit
- interface SharedArrayBuffer
- interface StreamPipeOptions
- interface Timer
- interface Transformer
- interface Uint8ArrayConstructor
- interface WebSocket
Provides the API for creating and managing a WebSocket connection to a server, as well as for sending and receiving data on the connection.
- interface Worker
This Web Workers API interface represents a background task that can be easily created and can send messages back to its creator.
- interface WorkerOptions
Bun's Web Worker constructor supports some extra options on top of the API browsers have.
Variables 10
- const console
- const crypto
MDN Reference
- const Error
- const exports
Same as module.exports
- const Loader
Low-level JavaScriptCore API for accessing the native ES Module loader (not a Bun API)
- const module
A reference to the current module.
- const navigator
MDN Reference
- const performance
MDN Reference
- const require
NodeJS-style
requirefunction - const SharedArrayBuffer
Namespaces 3
- namespace fetch
Bun's extensions of the
fetchAPI - namespace setImmediate
- namespace setTimeout