Convert between fetch-compatible Request/Response objects and Node.js http.IncomingMessage/ServerResponse for use in WinterTC runtimes (Cloudflare Workers, Bun, Deno, Fastly Compute). v2.1.0 is stable, actively maintained, and ships TypeScript definitions. Unlike alternatives like @fastly/http-compute-js, it has zero runtime dependencies beyond Node.js compatibility shims (Readable, Writable, Buffer). Ideal for running Express or other Node.js HTTP middleware in edge environments.
npm install fetch-to-nodeNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows the core usage: converts a fetch Request to Node.js req/res objects, writes a response using Node.js API, and converts back to a fetch Response.
Always call res.end() after writing headers and body, or use a timeout.
No workaround; use a different library if HTTP/2 is required.
Clone the Request if its body is needed elsewhere, or read body before passing to toReqRes.
Avoid relying on socket properties; for example, req.socket.remoteAddress may be undefined.
Enable the `nodejs_compat` flag in Cloudflare Workers (wrangler.toml: `nodejs_compat = true`).
Ensure res.end() is called after writing all data.
Install with `npm install fetch-to-node`. Use `import` syntax (ESM) as the library does not provide a CommonJS entry.