@eyalsh/express-sse
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

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');
});

Readme

Keywords

none

Package Sidebar

Install

npm i @eyalsh/express-sse

Weekly Downloads

3

Version

1.0.1

License

ISC

Unpacked Size

5.62 kB

Total Files

6

Last publish

Collaborators

  • eyalsh