pubsweet-sse

1.0.55 • Public • Published

pubsweet-sse

Broadcast server-sent events to connected Express clients.

Install

npm install pubsweet-sse

or

yarn install pubsweet-sse

Example usage in Express

const sse = require('pubsweet-sse')

// set the /updates route for authenticated clients to connect using EventSource
app.get('/updates', passport.authenticate('bearer'), sse.connect)

// broadcast data to all connected clients
sse.send({ foo: 'bar' })

Alternatives

This module was originally adapted from express-sse

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i pubsweet-sse

      Weekly Downloads

      245

      Version

      1.0.55

      License

      MIT

      Unpacked Size

      16.1 kB

      Total Files

      5

      Last publish

      Collaborators

      • jure
      • yannisbarlas
      • andrei.c9
      • shockandaudrey