GitHub - Fire-/eventsource-node: EventSource client for Node.js · GitHub
Skip to content

Fire-/eventsource-node

 
 

Folders and files

Repository files navigation

Build Status

EventSource

This library implements the EventSource client for Node.js. The API aims to be W3C compatible.

Install

npm install eventsource

Usage

var EventSource = require('eventsource');

es = new EventSource('http://googlecodesamples.com/html5/sse/sse.php');
es.onmessage = function(e) {
    console.log(e.data);
};
es.onerror = function() {
    console.log('ERROR!');
};

See the spec for API docs.

Example

See https://github.com/einaros/sse-example

About

EventSource client for Node.js

Resources

License

Stars

Watchers

Forks

Packages

Contributors

Languages

  • JavaScript 100.0%