# http-sse

> Create server-sent-events

Latest version **1.0.0** (published 2017-07-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install http-sse
pnpm add http-sse
yarn add http-sse
bun add http-sse
```

## 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 | 1.0.0 |
| Published | 2017-07-19 |
| First published | 2017-07-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | yoshuawuyts |
| Keywords | sse, node |

## Links

- npm: https://www.npmjs.com/package/http-sse
- Repository: https://github.com/yoshuawuyts/http-sse
- Homepage: https://github.com/yoshuawuyts/http-sse#readme
- Issues: https://github.com/yoshuawuyts/http-sse/issues
- npm.io page: https://npm.io/package/http-sse

## Alternatives

- [@expo/fingerprint](https://npm.io/package/@expo/fingerprint.md) — 6.2M weekly downloads
- [@azure/monitor-opentelemetry-exporter](https://npm.io/package/@azure/monitor-opentelemetry-exporter.md) — 850.0K weekly downloads
- [@azure/monitor-opentelemetry](https://npm.io/package/@azure/monitor-opentelemetry.md) — 624.0K weekly downloads
- [@posthog/ai](https://npm.io/package/@posthog/ai.md) — 423.3K weekly downloads
- [fakefilter](https://npm.io/package/fakefilter.md) — 63.9K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2017-07-19

## README

# http-sse [![stability][0]][1]
[![npm version][2]][3] [![build status][4]][5]
[![downloads][8]][9] [![js-standard-style][10]][11]

Create server-sent-events

## Usage
```js
var Sse = require('http-sse')
var http = require('http')

http.createServer(function (req, res) {
  var sse = Sse(req, res)
  sse.write('foo', 'bar')
  sse.write('bin', 'baz')
  sse.end('beep', 'boop')
})
```

## API
### `sse = Sse(req, res)`
Create a new SSE instance.

### `sse.write(name, data)`
Write a new message to the SSE stream.

### `sse.end([name], [data])`
Close the SSE stream.

## See Also
- https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events

## License
[MIT](https://tldrlegal.com/license/mit-license)

[0]: https://img.shields.io/badge/stability-experimental-orange.svg?style=flat-square
[1]: https://nodejs.org/api/documentation.html#documentation_stability_index
[2]: https://img.shields.io/npm/v/http-sse.svg?style=flat-square
[3]: https://npmjs.org/package/http-sse
[4]: https://img.shields.io/travis/yoshuawuyts/http-sse/master.svg?style=flat-square
[5]: https://travis-ci.org/yoshuawuyts/http-sse
[6]: https://img.shields.io/codecov/c/github/yoshuawuyts/http-sse/master.svg?style=flat-square
[7]: https://codecov.io/github/yoshuawuyts/http-sse
[8]: http://img.shields.io/npm/dm/http-sse.svg?style=flat-square
[9]: https://npmjs.org/package/http-sse
[10]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square
[11]: https://github.com/feross/standard

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