Skip to content
Myr

Document how to do SSE

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Fixes #777

authored by Sindre Sorhus · committed by Sindre Sorhus · parent fec6c43 · Browse files · 1 file+15 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+15 added−0 removed

  • other:+15 added−0 removed

1 file+15 added−0 removed

modified:readme.md+15 added
1087 unmodified lines
1088 dispatcher: proxyAgent1089}).json();1090```10911092### Consuming Server-Sent Events (SSE)10931094Use [`parse-sse`](https://github.com/sindresorhus/parse-sse):10951096```js1097import ky from 'ky';1098import {parseServerSentEvents} from 'parse-sse';10991100const response = await ky('https://api.example.com/events');11011102for await (const event of parseServerSentEvents(response)) {1103 console.log(event.data);1104}1105```11061107## FAQ11081109#### How do I use this in Node.js?1110
61 unmodified lines