Skip to content

queckezz/co-sse-events

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

co-sse-events

A sse stream based on events. Wrap an emitter with this module to emit sse events.

Installation

$ npm install co-sse-events

Example

Returns events in sequence based on the sse spec

var emitter = new Emitter;

var e;
while (e = yield sse(emitter)) {
  console.log(e.out)
  /* ->
   *   event: test
   *   data: { some: prop }
   *
   * ->
   *   event: test
   *   data: 'prop'
   */
}

emitter
  .emit('test', { some: prop })
  .emit('test', 'prop')

About

Stream Server-Sent Events from an emitter

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published