JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 6411
  • Score
    100M100P100Q128411F
  • License MIT

An Express middleware for Server-Sent Events (EventSource)

Package Exports

  • express-sse

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (express-sse) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

#event-stream

NPM

An Express middleware for quick'n'easy server-sent events.

##Installation: npm install express-sse

##Usage example: ###Server:

var SSE = require('express-sse');
var sse = new SSE(["array", "containing", "initial", "content", "(optional)"]);

...

app.get('/stream', sse.init);

...

sse.send(content);
sse.updateInit(["array", "containing", "new", "initial", "content"]);

###Client:

var es = new EventSource('/stream');

es.onmessage = function (event) {
  ...
};