Streaming — Basics · Hono

Answer before the whole body exists: a text export written line by line with streamText(), and a feed of server-sent events with streamSSE() that keeps the connection open.

What you will learn

Read the theory for Streaming

All Basics lessons

All Hono courses

loading types…

What you'll learn

  • Stream a text body with streamText() and its write(), writeln() and sleep()
  • Send server-sent events with streamSSE() and writeSSE({ event, data, id }), and stop when the client goes away
  • Understand why an error inside a stream cannot become an error response