Skip to content

Node.js compatibility

The pinned baseline already includes Node compatibility, so node: imports do not need a project-level flag. This is not a Node host: there is no node_modules runtime, no full Node standard library as an OS, and unimplemented APIs are not polyfilled.

ts
import { Buffer } from "node:buffer";
import { createHash } from "node:crypto";

export default {
  fetch(): Response {
    const digest = createHash("sha256").update(Buffer.from("ok")).digest("hex");
    return new Response(digest);
  },
} satisfies ExportedHandler;

The toolchain does not provide a Node runtime, does not fill in unimplemented product APIs, and does not download remote imports.

Compatibility

TopicCloudflareopen-compute
Available node: modulesYes — Node.js compatibilityAligned with pinned workerd at this compatibility date
Successful import means full NodeNoNo
Per-Worker nodejs_compat flag to turn offYesNot provided; included in the baseline
Unimplemented Node APIsFail or flag-gatedFail; not silently polyfilled
node:net outboundCloudflare hosted network policySame general outbound; see TCP sockets
Request-path runtimeworkerdworkerd; production requests do not execute inside Bun/Node