better-sse 0.15.1 → 0.16.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -3
- package/build/index.cjs +771 -0
- package/build/index.d.cts +662 -0
- package/build/index.d.mts +580 -415
- package/build/index.mjs +728 -744
- package/package.json +15 -16
- package/build/index.d.ts +0 -497
- package/build/index.js +0 -807
package/README.md
CHANGED
|
@@ -39,7 +39,7 @@ Read the [Getting Started](https://matthewwid.github.io/better-sse/guides/gettin
|
|
|
39
39
|
|
|
40
40
|
## Highlights
|
|
41
41
|
|
|
42
|
-
* Compatible with all popular
|
|
42
|
+
* Compatible with all popular frameworks and runtimes ([Express](https://nodejs.org/api/http.html), [Hono](https://hono.dev/), [Fastify](https://fastify.dev/), [Nest](https://nestjs.com/), [Next.js](https://nextjs.org/), [Bun](https://bun.sh/docs/api/http), [Deno](https://docs.deno.com/runtime/fundamentals/http_server/), [etc.](https://matthewwid.github.io/better-sse/reference/recipes/))
|
|
43
43
|
* Fully written in TypeScript (+ ships with types directly).
|
|
44
44
|
* [Thoroughly tested](./src/Session.test.ts) (+ 100% code coverage!).
|
|
45
45
|
* [Comprehensively documented](https://matthewwid.github.io/better-sse) with guides and API documentation.
|
|
@@ -115,7 +115,7 @@ app.get("/sse", (c) =>
|
|
|
115
115
|
// Client
|
|
116
116
|
const eventSource = new EventSource("/sse")
|
|
117
117
|
|
|
118
|
-
eventSource.addEventListener("message", ({ data })
|
|
118
|
+
eventSource.addEventListener("message", ({ data }) => {
|
|
119
119
|
const contents = JSON.parse(data)
|
|
120
120
|
console.log(contents) // Hello world!
|
|
121
121
|
})
|
|
@@ -167,7 +167,7 @@ Check the [API documentation](https://matthewwid.github.io/better-sse/reference/
|
|
|
167
167
|
|
|
168
168
|
# Documentation
|
|
169
169
|
|
|
170
|
-
|
|
170
|
+
See [the documentation website](https://matthewwid.github.io/better-sse/) for guides, usage examples, compatibility information and an API reference.
|
|
171
171
|
|
|
172
172
|
# Contributing
|
|
173
173
|
|
|
@@ -212,6 +212,29 @@ Bundle for distribution (with [tsup](https://tsup.egoist.dev/)):
|
|
|
212
212
|
pnpm build
|
|
213
213
|
```
|
|
214
214
|
|
|
215
|
+
## Documentation
|
|
216
|
+
|
|
217
|
+
The documentation is built with [Astro](https://astro.build/) and [Starlight](https://starlight.astro.build/). Its source is located in the `docs` directory.
|
|
218
|
+
|
|
219
|
+
Install dependencies:
|
|
220
|
+
|
|
221
|
+
```bash
|
|
222
|
+
cd docs
|
|
223
|
+
pnpm i
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
Run development server:
|
|
227
|
+
|
|
228
|
+
```bash
|
|
229
|
+
pnpm dev
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
Build for distribution:
|
|
233
|
+
|
|
234
|
+
```bash
|
|
235
|
+
pnpm build
|
|
236
|
+
```
|
|
237
|
+
|
|
215
238
|
# License
|
|
216
239
|
|
|
217
240
|
This project is licensed under the [MIT license](https://opensource.org/license/mit/).
|