Skip to main content
workerd implements a subset of Node.js built-in modules. This page lists all supported modules and their implementation status.

Core modules

These modules are fully or substantially implemented and available with the nodejs_compat compatibility flag.

assert

import assert from 'node:assert';
Provides assertion functions for testing and validation. Both the main module and node:assert/strict are available. Status: Fully functional

async_hooks

import { AsyncLocalStorage } from 'node:async_hooks';
Provides AsyncLocalStorage for context management across asynchronous operations. Can be enabled independently via the nodejs_als compatibility flag. Key APIs:
  • AsyncLocalStorage
  • AsyncResource
Status: Fully functional

buffer

import { Buffer } from 'node:buffer';
Provides the Buffer class for binary data manipulation. Implemented in C++ for performance. Key APIs:
  • Buffer class with all standard methods
  • SlowBuffer
  • Constants: INSPECT_MAX_BYTES, kMaxLength, kStringMaxLength
Status: Fully functional Location: src/workerd/api/node/buffer.{h,c++}

crypto

import crypto from 'node:crypto';
Provides cryptographic functionality built on BoringSSL. Implements a substantial subset of Node.js crypto APIs. Key APIs:
  • createHash(), createHmac()
  • createSign(), createVerify()
  • createCipheriv(), createDecipheriv()
  • generateKeyPair(), generateKeyPairSync()
  • randomBytes(), randomFill(), randomInt(), randomUUID()
  • pbkdf2(), scrypt(), hkdf()
  • getCiphers(), getHashes(), getCurves()
  • Key objects: KeyObject, CryptoKey
Status: Substantially implemented Location: src/workerd/api/node/crypto.{h,c++}

diagnostics_channel

import diagnosticsChannel from 'node:diagnostics_channel';
Provides a messaging channel for diagnostics and monitoring. Key APIs:
  • channel(name)
  • hasSubscribers(name)
  • subscribe(name, callback)
  • unsubscribe(name, callback)
  • Channel class
Status: Fully functional Location: src/workerd/api/node/diagnostics-channel.{h,c++}

events

import { EventEmitter } from 'node:events';
Provides the EventEmitter class for event-driven programming. Status: Fully functional

path

import path from 'node:path';
// or
import posix from 'node:path/posix';
import win32 from 'node:path/win32';
Provides utilities for working with file and directory paths. Key APIs:
  • basename(), dirname(), extname()
  • join(), resolve(), relative()
  • normalize(), isAbsolute()
  • parse(), format()
  • Platform-specific: path.posix, path.win32
Status: Fully functional

process

import process from 'node:process';
Provides information about the current process and environment. Key APIs:
  • process.env (with nodejs_compat_populate_process_env flag)
  • process.nextTick()
  • process.version, process.versions
  • process.platform, process.arch
  • Event emitter methods
Status: Partially implemented (some properties are stubs) Location: src/workerd/api/node/process.{h,c++}

stream

import { Readable, Writable, Transform } from 'node:stream';
// or submodule imports
import { Readable } from 'node:stream/readable';
Provides stream interfaces compatible with Node.js streams. Key APIs:
  • Readable, Writable, Duplex, Transform, PassThrough
  • pipeline(), finished()
  • Submodules: stream/consumers, stream/promises, stream/web
Status: Substantially implemented

string_decoder

import { StringDecoder } from 'node:string_decoder';
Provides decoding of Buffer objects into strings. Status: Fully functional

timers

import { setTimeout, setInterval } from 'node:timers';
import { setTimeout as setTimeoutPromise } from 'node:timers/promises';
Provides timer functions. Also available in node:timers/promises for promise-based APIs. Status: Fully functional Location: src/workerd/api/node/timers.{h,c++}

url

import { URL, URLSearchParams } from 'node:url';
Provides URL parsing and manipulation utilities. Uses the ada-url library for WHATWG URL compliance. Key APIs:
  • URL, URLSearchParams classes
  • parse(), format(), resolve()
  • fileURLToPath(), pathToFileURL()
Status: Fully functional Location: src/workerd/api/node/url.{h,c++}

util

import util from 'node:util';
import { promisify } from 'node:util';
Provides utility functions for various programming tasks. Key APIs:
  • promisify(), callbackify()
  • inspect()
  • format(), formatWithOptions()
  • types object with type checking utilities
  • TextEncoder, TextDecoder
  • isDeepStrictEqual()
Status: Substantially implemented Location: src/workerd/api/node/util.{h,c++}

zlib

import zlib from 'node:zlib';
Provides compression and decompression using gzip, deflate, and brotli algorithms. Key APIs:
  • gzip(), gunzip(), gzipSync(), gunzipSync()
  • deflate(), inflate(), deflateSync(), inflateSync()
  • brotliCompress(), brotliDecompress()
  • createGzip(), createGunzip(), createDeflate(), createInflate()
  • Constants and options for compression
Status: Fully functional (streaming classes require nodejs_zlib flag) Location: src/workerd/api/node/zlib-util.{h,c++}

Network modules

These modules require additional compatibility flags and have limitations compared to Node.js.

dns

import dns from 'node:dns';
import dnsPromises from 'node:dns/promises';
Provides DNS lookup functionality. Note: Implementation may be backed by C++ or Rust depending on the RUST_BACKED_NODE_DNS autogate. Status: Partially implemented Location: src/workerd/api/node/dns.{h,c++}

http

import http from 'node:http';
Provides HTTP client functionality. Requires the enable_nodejs_http_modules flag. Key APIs:
  • request(), get()
  • Internal modules: _http_agent, _http_client, _http_common, _http_incoming, _http_outgoing
Status: Partially implemented (client only, no server without additional flag)

https

import https from 'node:https';
Provides HTTPS client functionality. Requires the enable_nodejs_http_modules flag. Status: Partially implemented (client only)

http2

import http2 from 'node:http2';
Provides HTTP/2 functionality. Requires the enable_nodejs_http2_module flag. Status: Partially implemented

net

import net from 'node:net';
Provides TCP socket functionality. Status: Partially implemented (limited by runtime environment)

tls

import tls from 'node:tls';
Provides TLS/SSL functionality. Includes internal modules _tls_common and _tls_wrap. Status: Partially implemented

Filesystem

fs

import fs from 'node:fs';
import fsPromises from 'node:fs/promises';
Provides filesystem operations. Requires the enable_nodejs_fs_module flag. Status: Partially implemented (limited filesystem access in Workers environment)

System information

os

import os from 'node:os';
Provides operating system information. Requires the enable_nodejs_os_module flag. Status: Partially implemented (some values may be stubs)

Advanced modules

module

import module from 'node:module';
Provides utilities for working with modules. Status: Partially implemented Location: src/workerd/api/node/module.{h,c++}

querystring

import querystring from 'node:querystring';
Provides utilities for parsing and formatting URL query strings. Status: Fully functional

sqlite

import sqlite from 'node:sqlite';
Provides SQLite database functionality. Requires the enable_nodejs_sqlite_module flag. Status: Functional (experimental) Location: src/workerd/api/node/sqlite.{h,c++}

test

import test from 'node:test';
Provides a test runner API. Status: Stub implementation

Non-functional stub modules

These modules are provided as non-functional stubs to prevent import errors when running code designed for Node.js. They require specific compatibility flags and throw errors when used.
The following modules are non-functional stubs:
  • node:child_process (requires enable_nodejs_child_process_module)
  • node:cluster (requires enable_nodejs_cluster_module)
  • node:console (requires enable_nodejs_console_module)
  • node:dgram (requires enable_nodejs_dgram_module)
  • node:domain (requires enable_nodejs_domain_module)
  • node:inspector (requires enable_nodejs_inspector_module)
  • node:perf_hooks (requires enable_nodejs_perf_hooks_module)
  • node:punycode (requires enable_nodejs_punycode_module)
  • node:readline (requires enable_nodejs_readline_module)
  • node:repl (requires enable_nodejs_repl_module)
  • node:trace_events (requires enable_nodejs_trace_events_module)
  • node:tty (requires enable_nodejs_tty_module)
  • node:v8 (requires enable_nodejs_v8_module)
  • node:vm (requires enable_nodejs_vm_module)
  • node:wasi (requires enable_nodejs_wasi_module)
  • node:worker_threads (requires enable_nodejs_worker_threads_module)
  • node:_stream_wrap (requires enable_nodejs_stream_wrap_module)
These modules are available for import but will throw errors or return stub implementations when you call their methods. They exist to improve compatibility with npm packages that conditionally import these modules.

Implementation locations

Node.js compatibility is implemented across two directories:
  • C++ layer: src/workerd/api/node/ - Native implementations registered via NODEJS_MODULES macro in node.h
  • TypeScript layer: src/node/ - Public node:* modules that import from node-internal:* specifiers

Check module availability

Module availability depends on your compatibility date and flags. To check if a module is available:
try {
  const crypto = await import('node:crypto');
  console.log('crypto module available');
} catch (e) {
  console.log('crypto module not available');
}
For modules requiring specific flags, ensure you have the appropriate flag enabled in your configuration or that your compatibility date includes the auto-enabled flag.

Build docs developers (and LLMs) love