/Knowledge/sources/honojs__hono/llms-full/streaming-helper-streamtext--35e68934d653.md
Streaming Helper: streamText() - hono-docs
Streaming Helper: streamText() Source evidence: /Sources/honojs hono/provenance.md Canonical citation: https://hono.dev/llms full.txt streamtext Summary It r...
Streaming Helper: streamText()
Source evidence: /Sources/honojs__hono/provenance.md Canonical citation: https://hono.dev/llms-full.txt#streamtext
Summary
It returns a streaming response with Content-Type: text/plain, Transfer-Encoding: chunked, and X-Content-Type-Options: nosniff headers. ```ts app.get('/streamText', (c) => { return streamText(c, async (stream) => { // Write a text...
Content
It returns a streaming response with Content-Type: text/plain, Transfer-Encoding: chunked, and X-Content-Type-Options: nosniff headers.
app.get('/streamText', (c) => {
return streamText(c, async (stream) => {
// Write a text with a new line ('\n').
await stream.writeln('Hello')
// Wait 1 second.
await stream.sleep(1000)
// Write a text without a new line.
await stream.write(`Hono!`)
})
})
::: warning
If you are developing an application for Cloudflare Workers, streaming may not work well on Wrangler. If so, add Identity for Content-Encoding header.
app.get('/streamText', (c) => {
c.header('Content-Encoding', 'Identity')
return streamText(c, async (stream) => {
// ...
})
})
:::
Metadata
{
"chunk_index": 0,
"citation": "https://hono.dev/llms-full.txt#streamtext",
"coverage_role": "overview",
"qualified_title": "Hono / llms-full / Streaming Helper > `streamText()`",
"retrieved_at": "2026-07-02T05:51:01Z",
"section_index": 675,
"source_id": "/honojs/hono",
"source_type": "llms_full",
"target_label": "llms-full",
"title": "Streaming Helper: streamText()",
"upstream_url": "https://hono.dev/llms-full.txt",
"version": "2026"
}