Skip to content

Write HTML. Render video. Built for agents.

303 B
Raw Blame
export async function readNodeRequestBody(
  req: AsyncIterable<string | Uint8Array>,
): Promise<Buffer> {
  const chunks: Uint8Array[] = [];

  for await (const chunk of req) {
    chunks.push(typeof chunk === "string" ? Buffer.from(chunk) : Buffer.from(chunk));
  }

  return Buffer.concat(chunks);
}