/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"
}
Kinic Wiki
Loading knowledge node
Details

Identity

database
db_23dhmsxlhukv
database_id
db_23dhmsxlhukv
path
/Knowledge/sources/honojs__hono/llms-full/streaming-helper-streamtext--35e68934d653.md
kind
directory
role
markdown_note
children
0

Metadata

created_at
virtual
updated_at
virtual
etag
virtual
metadata_json
{}

Lint Hints

No lightweight warnings.

Outgoing Links

No outgoing links indexed.

Incoming Links

Select a file node to inspect backlinks.

Raw Source

No raw source path inferred.