npm packages intended for Node.js work with Bun. To ensure compatibility, we run thousands of tests from Node.jsβ test suite before every release of Bun.
If a package works in Node.js but doesnβt work in Bun, we consider it a bug in Bun. Open an issue and weβll fix it.
This page is updated regularly and reflects the latest version of Bunβs compatibility with Node.js v23.
Built-in Node.js modules
node:assert
π’ Fully implemented.
node:buffer
π’ Fully implemented.
node:console
π’ Fully implemented.
node:dgram
π’ Fully implemented. > 90% of Node.jsβs test suite passes.
node:diagnostics_channel
π’ Fully implemented.
node:dns
π’ Fully implemented. > 90% of Node.jsβs test suite passes.
node:events
π’ Fully implemented. 100% of Node.jsβs test suite passes. EventEmitterAsyncResource uses AsyncResource underneath.
node:fs
π’ Fully implemented. 92% of Node.jsβs test suite passes.
node:http
π’ Fully implemented. The outgoing client request body is buffered instead of streamed.
node:https
π’ APIs are implemented, but Agent is not always used.
node:os
π’ Fully implemented. 100% of Node.jsβs test suite passes.
node:path
π’ Fully implemented. 100% of Node.jsβs test suite passes.
node:punycode
π’ Fully implemented. 100% of Node.jsβs test suite passes, deprecated by Node.js.
node:querystring
π’ Fully implemented. 100% of Node.jsβs test suite passes.
node:readline
π’ Fully implemented.
node:stream
π’ Fully implemented.
node:string_decoder
π’ Fully implemented. 100% of Node.jsβs test suite passes.
node:timers
π’ Use the global setTimeout and related functions instead.
node:tty
π’ Fully implemented.
node:url
π’ Fully implemented.
node:zlib
π’ Fully implemented. 98% of Node.jsβs test suite passes.
node:async_hooks
π‘ AsyncLocalStorage and AsyncResource are implemented. v8 promise hooks are not called, and its usage is strongly discouraged.
node:child_process
π‘ Missing proc.gid proc.uid. Stream class not exported. IPC cannot send socket handles. Node.js β Bun IPC can be used with JSON serialization.
node:cluster
π‘ Handles and file descriptors cannot be passed between workers, so load-balancing HTTP requests across processes is only supported on Linux (through SO_REUSEPORT). Otherwise, implemented but not battle-tested.
node:crypto
π‘ Missing secureHeapUsed setEngine setFips
node:domain
π‘ Missing Domain active
node:http2
π‘ Client & server are implemented (95.25% of gRPCβs test suite passes). Missing options.allowHTTP1, options.enableConnectProtocol, ALTSVC extension, and http2stream.pushStream.
node:module
π‘ Missing syncBuiltinESMExports, Module#load(). Overriding require.cache is supported for ESM & CJS modules. module._extensions, module._pathCache, module._cache are no-ops. module.register is not implemented; we recommend Bun.plugin instead.
node:net
π’ Fully implemented.
node:perf_hooks
π‘ APIs are implemented, but the Node.js test suite for this module does not pass.
node:process
π‘ See process Global.
node:sys
π‘ See node:util.
node:tls
π‘ Missing tls.createSecurePair.
node:util
π‘ Missing getCallSite getCallSites getSystemErrorMap getSystemErrorMessage transferableAbortSignal transferableAbortController
node:v8
π‘ writeHeapSnapshot and getHeapSnapshot are implemented. serialize and deserialize use JavaScriptCoreβs wire format instead of V8βs. Other methods are not implemented. For profiling, use bun:jsc instead.
node:vm
π‘ Core functionality and ES modules are implemented, including vm.Script, vm.createContext, vm.runInContext, vm.runInNewContext, vm.runInThisContext, vm.compileFunction, vm.isContext, vm.Module, vm.SourceTextModule, vm.SyntheticModule, and importModuleDynamically support. Options like timeout and breakOnSigint are fully supported. Missing vm.measureMemory and some cachedData functionality.
node:wasi
π‘ Partially implemented.
node:worker_threads
π‘ Worker doesnβt support the following options: stdin stdout stderr trackedUnmanagedFds resourceLimits. Missing markAsUntransferable moveMessagePortToContext.
node:inspector
π‘ Partially implemented. The Profiler API is supported (Profiler.enable, Profiler.disable, Profiler.start, Profiler.stop, Profiler.setSamplingInterval). Other inspector APIs are not implemented.
node:repl
π΄ Not implemented.
node:sqlite
π΄ Not implemented.
node:test
π‘ Partially implemented. Missing mocks, snapshots, timers. Use bun:test instead.
node:trace_events
π΄ Not implemented.
Node.js globals
The following list covers every global implemented by Node.js and Bunβs compatibility status for each.AbortController
π’ Fully implemented.
AbortSignal
π’ Fully implemented.
Blob
π’ Fully implemented.
Buffer
π’ Fully implemented.
ByteLengthQueuingStrategy
π’ Fully implemented.
__dirname
π’ Fully implemented.
__filename
π’ Fully implemented.
atob()
π’ Fully implemented.
Atomics
π’ Fully implemented.
BroadcastChannel
π’ Fully implemented.
btoa()
π’ Fully implemented.
clearImmediate()
π’ Fully implemented.
clearInterval()
π’ Fully implemented.
clearTimeout()
π’ Fully implemented.
CompressionStream
π’ Fully implemented.
console
π’ Fully implemented.
CountQueuingStrategy
π’ Fully implemented.
Crypto
π’ Fully implemented.
SubtleCrypto (crypto)
π’ Fully implemented.
CryptoKey
π’ Fully implemented.
CustomEvent
π’ Fully implemented.
DecompressionStream
π’ Fully implemented.
Event
π’ Fully implemented.
EventTarget
π’ Fully implemented.
exports
π’ Fully implemented.
fetch
π’ Fully implemented.
FormData
π’ Fully implemented.
global
π’ Implemented. global is an object containing all objects in the global namespace. Itβs rarely referenced directly, as its contents are available without a prefix, for example __dirname instead of global.__dirname.
globalThis
π’ Aliases to global.
Headers
π’ Fully implemented.
MessageChannel
π’ Fully implemented.
MessageEvent
π’ Fully implemented.
MessagePort
π’ Fully implemented.
module
π’ Fully implemented.
PerformanceEntry
π’ Fully implemented.
PerformanceMark
π’ Fully implemented.
PerformanceMeasure
π’ Fully implemented.
PerformanceObserver
π’ Fully implemented.
PerformanceObserverEntryList
π’ Fully implemented.
PerformanceResourceTiming
π’ Fully implemented.
performance
π’ Fully implemented.
process
π‘ Mostly implemented. process.binding (internal Node.js bindings some packages rely on) is partially implemented. process.title is a no-op on macOS & Linux. getActiveResourcesInfo setActiveResourcesInfo, getActiveResources and setSourceMapsEnabled are stubs. Newer APIs like process.loadEnvFile and process.getBuiltinModule are not implemented.
queueMicrotask()
π’ Fully implemented.
ReadableByteStreamController
π’ Fully implemented.
ReadableStream
π’ Fully implemented.
ReadableStreamBYOBReader
π’ Fully implemented.
ReadableStreamBYOBRequest
π’ Fully implemented.
ReadableStreamDefaultController
π’ Fully implemented.
ReadableStreamDefaultReader
π’ Fully implemented.
require()
π’ Fully implemented, including require.main, require.cache, require.resolve.