Sse
A Server-Sent Events component
Install / Use
/learn @segment-boneyard/SseREADME
sse
A nice Server-Sent Events api
Example
With a SSE endpoint that responds like this:
$ curl http://localhost/updates
data: foo
data: bar
data: quit
And a script that subscribes to its updates:
var sse = require('sse');
var unbind = sse('/updates', function(data){
if (data == 'quit') unbind();
console.log(data);
});
The console output will be:
foo
bar
quit
Installation
Install with component(1):
$ component install segmentio/sse
API
sse(url, fn)
Subscribe fn to events on url. Returns an unbind function.
License
MIT
Related Skills
node-connect
330.3kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
81.3kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
330.3kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
81.3kCommit, push, and open a PR
