# express-eventsource

> Server-sent events middleware for expressjs

Latest version **0.0.4** (published 2015-07-21) · BSD license · 0 weekly downloads

## Install

```sh
npm install express-eventsource
pnpm add express-eventsource
yarn add express-eventsource
bun add express-eventsource
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.4 |
| Published | 2015-07-21 |
| First published | 2013-07-07 |
| Weekly downloads | 0 |
| License | BSD |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6 |
| Author | jinroh |
| Maintainers | jinroh |
| Keywords | server-sent-events, sse, event-source, express, expressjs, middleware |

## Links

- npm: https://www.npmjs.com/package/express-eventsource
- Repository: https://github.com/jinroh/express-eventsource
- Issues: https://github.com/jinroh/express-eventsource/issues
- npm.io page: https://npm.io/package/express-eventsource

## Alternatives

- [async-exit-hook](https://npm.io/package/async-exit-hook.md) — 3.7M weekly downloads
- [evnty](https://npm.io/package/evnty.md) — 7.2K weekly downloads
- [eleventy-plugin-asciidoc](https://npm.io/package/eleventy-plugin-asciidoc.md) — 3.5K weekly downloads
- [@jswork/next-get2get](https://npm.io/package/@jswork/next-get2get.md) — 945 weekly downloads
- [@dashersw/axon](https://npm.io/package/@dashersw/axon.md) — 934 weekly downloads

## Recent versions

- 0.0.4 (latest) — 2015-07-21
- 0.0.3 — 2013-07-21
- 0.0.2 — 2013-07-07
- 0.0.1 — 2013-07-07

## README

# Express EventSource

This express module creates a simple server-sent events room.

http://www.w3.org/TR/eventsource/

## Installation

```sh
$ npm install express-eventsource
```

## Example

```javascript
var express = require('express');
var eventsource = require('express-eventsource');

var sse = eventsource({
  connections: 2
});

var broadcast = sse.sender('foo');

var app = express()
  .use(sse.middleware())
  .listen(3000);

setInterval(function() {
  broadcast({ bar: 'baz' }); // <=> sse.send({ bar: 'baz' }, 'foo')
}, 2000);
```

(see `/examples`)

## License

License
(The MIT License)

Copyleft (<3) 2013 jinroh.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

---
_Source: https://npm.io/package/express-eventsource · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
