# pamplemousse

> Delicious SSE (server sent events) for ExpressJS and browserify

Latest version **2.0.0** (published 2018-05-31) · MIT license · 0 weekly downloads

## Install

```sh
npm install pamplemousse
pnpm add pamplemousse
yarn add pamplemousse
bun add pamplemousse
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2018-05-31 |
| First published | 2014-05-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.10 |
| Dependencies | 0 |
| Unpacked size | 6.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Mike MacCana |
| Maintainers | mikemaccana |
| Keywords | pamplemousse, sse, server sent events, realtime, browser |

## Links

- npm: https://www.npmjs.com/package/pamplemousse
- Repository: https://github.com/mikemaccana/pamplemousse
- npm.io page: https://npm.io/package/pamplemousse

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 2.0.0 (latest) — 2018-05-31
- 1.0.0 — 2015-09-19
- 0.2.1 — 2014-05-14
- 0.2.0 — 2014-05-14

## README

![Pamplemousse JS](http://pamplemoussejs.org/images/pamplemousse.png)

## Delicious SSE for the browser and Express 4

Features include:

 - Multiple channels!
 - Browserify code for the browser (`pamplemousse-browser`) and for ExpressJS (`pamplemousse`)
 - Takes care of keepalives!

## On the server

	var pamplemouse = require('pamplemousse')()

In your routes:

	router.get('/orders/:orderID/status', function(req, res) {
		var orderID = req.params.orderID
		pamplemouse.subscribeToChannel(orderID, res)
	});

When you'd like to send an update to connected clients, run sendToActiveChannels:

	sendToActiveChannels(function(activeChannel){
		pamplemousse.sendUpdate(activeChannel, 'you are subscribed to '+activeChannel)
	})

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