A module which provides methods for encoding and decoding sse-events (Server Sent Events), cross-posted to npm as @codemonument/sse-codec
Attributes
Includes Deno configuration
Repository
Current version released
3 years ago
Versions
Deno SSE Codec
A deno module packaging encoding & decoding functionality for SSE Events, as well as providing some types.
Usage in Deno
See the test files for most elaborate usage descriptions. Here’s the TL;DR
(adjust the import path to the complete URL from deno.land/x):
import { encodeSSEEvent } from "./encode-sse-event.ts";
const sseString = encodeSSEEvent({
name: "custom-event",
data: "Some simple string data",
id: "UID5346324874238475",
retry: 5000,
});