# extra-sse

> ```sh npm install --save extra-sse # or yarn add extra-sse ```

Latest version **0.5.0** (published 2025-06-16) · MIT license · 0 weekly downloads

## Install

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

## Health

**Score 40/100 (D)** — status: maintenance-mode.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.5.0 |
| Published | 2025-06-16 |
| First published | 2023-05-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=22 |
| Dependencies | 3 |
| Unpacked size | 21.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | BlackGlory |
| Maintainers | black_glory |

## Links

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

## Dependencies (3)

- [extra-stream](https://npm.io/package/extra-stream.md) ^0.3.1
- [extra-promise](https://npm.io/package/extra-promise.md) ^7.0.0
- [@blackglory/prelude](https://npm.io/package/@blackglory/prelude.md) ^0.4.0

## Recent versions

- 0.5.0 (latest) — 2025-06-16
- 0.4.0 — 2025-05-25
- 0.3.3 — 2025-05-25
- 0.3.2 — 2024-12-23
- 0.3.1 — 2023-08-02
- 0.3.0 — 2023-06-09
- 0.2.1 — 2023-06-09
- 0.2.0 — 2023-06-09
- 0.1.0 — 2023-05-04

## README

# extra-sse
## Install
```sh
npm install --save extra-sse
# or
yarn add extra-sse
```

## API
```ts
interface IEvent {
  comment?: string
  event?: string
  data?: string
  id?: string
  retry?: number
}
```

### stringifyEvent
```ts
function stringifyEvent(event: IEvent): IterableIterator<string>
```

### fetchEvents
```ts
/**
 * @throws {HTTPClientError}
 * @throws {AbortError}
 */
function fetchEvents(
  input: string | URL | Getter<Request>
, options?: {
    lastEventId?: string

    autoReconnect?: boolean = true
    retry?: number = 0

    /**
     * The handler is called when a connection is properly established.
     * The handler is also called when the connection is re-established.
     */
    onOpen?: () => void
  }
): AsyncIterableIterator<IEvent>
```

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