Web globals

Response.clone()

Creates a second readable response branch before consumption. Cloning large bodies may buffer data when consumers run at different speeds; prefer a single bounded consumer. Tested on Node.js 22.16.0. Example output (one line per entry): ["catalog,catalog"].

Formal Syntax & Structure

nodejs syntaxnodejs
response.clone()

Return Value

Response

Cloned response.

Working Example

Example Snippetnodejs
const r = new Response('catalog');const c = r.clone();console.log((await Promise.all([r.text(), c.text()])).join(','));
Node.js Reference