Home / Function/ write() — astro Function Reference

write() — astro Function Reference

Architecture documentation for the write() function in util.ts from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  8810f212_398f_b23a_f478_dead3b83984d["write()"]
  48bba3f8_c792_f2aa_c497_4f494ca2f1da["BufferedRenderer"]
  8810f212_398f_b23a_f478_dead3b83984d -->|defined in| 48bba3f8_c792_f2aa_c497_4f494ca2f1da
  87b072e3_880a_861b_20e6_451043e37f03["flush()"]
  87b072e3_880a_861b_20e6_451043e37f03 -->|calls| 8810f212_398f_b23a_f478_dead3b83984d
  style 8810f212_398f_b23a_f478_dead3b83984d fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/astro/src/runtime/server/render/util.ts lines 213–224

	public write(chunk: RenderDestinationChunk): void {
		// Before the buffer has been flushed, we want to
		// append to the buffer, afterwards we'll write
		// to the underlying destination if subsequent
		// writes arrive.

		if (this.flushed) {
			this.destination.write(chunk);
		} else {
			this.chunks.push(chunk);
		}
	}

Domain

Subdomains

Called By

Frequently Asked Questions

What does write() do?
write() is a function in the astro codebase, defined in packages/astro/src/runtime/server/render/util.ts.
Where is write() defined?
write() is defined in packages/astro/src/runtime/server/render/util.ts at line 213.
What calls write()?
write() is called by 1 function(s): flush.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free