@eyalsh/express-sse
v1.0.1
Published
Simple Express Server Sent Events Middleware (using TypeScript)
Downloads
1
Readme
Simple Express Server Sent Events Middleware (using TypeScript)
Example
import express from 'express';
import stream from 'express-sse';
const app = express();
const clockFn = async () => new Date(Date.now()).toLocaleTimeString();
app.use('/clock', stream('clock', clockFn));
app.listen(8080, () => {
console.log('listening on port 8080');
});