var source = new EventSource('path/to/event-stream') source.addEventListener('event', function (data) { console.log(data) });