← All recipes
Moderne licensed

Replace ServerResponse.writeHeader() with writeHead()

Recipe IDorg.openrewrite.node.migrate.http.replace-server-response-write-headerArtifact@openrewrite/recipes-nodejs

ServerResponse.prototype.writeHeader() was an undocumented alias for writeHead() that was deprecated in Node.js 11 (DEP0063) and removed in Node.js 26. The signatures are identical.

Single recipeDEP0063Proprietary

Usage

This recipe has no required configuration options. You’ll need the Moderne CLI configured before running the command below.

mod run . --recipe org.openrewrite.node.migrate.http.replace-server-response-write-header

If the recipe isn’t available locally, install it with:

mod config recipes npm install @openrewrite/recipes-nodejs