Node.js compatibility for Cloudflare Workers – starting with Async Context Tracking, EventEmitter, Buffer, assert, and util
Mar 23, 2023James M Snell

Summary
Introduced Node.js core API compatibility to Cloudflare Workers, starting with AsyncLocalStorage, EventEmitter, Buffer, assert, and parts of util. These APIs are provided directly by the workerd runtime, eliminating the need for polyfills. The implementation of AsyncLocalStorage is a subset of the Node.js API, omitting brittle features. EventEmitter fully supports the API, including captureRejections. Buffer extends Uint8Array and is compatible with existing Workers APIs. Assert module runs in strict mode. Promisify/callbackify APIs are also supported.