{"id":21703565,"url":"https://github.com/codemonument/deno_sse_codec","last_synced_at":"2025-12-11T21:15:40.756Z","repository":{"id":57699658,"uuid":"495925003","full_name":"codemonument/deno_sse_codec","owner":"codemonument","description":"A module which provides methods for encoding and decoding sse-events (Server Sent Events), cross-posted to npm as @codemonument/sse-codec","archived":false,"fork":false,"pushed_at":"2022-11-15T20:56:21.000Z","size":40,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-31T08:55:03.061Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codemonument.png","metadata":{"files":{"readme":"Readme.md","changelog":"Changelog.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-05-24T17:31:44.000Z","updated_at":"2022-11-11T08:56:56.000Z","dependencies_parsed_at":"2023-01-23T03:01:05.207Z","dependency_job_id":null,"html_url":"https://github.com/codemonument/deno_sse_codec","commit_stats":null,"previous_names":["codemonument/deno-sse-codec"],"tags_count":4,"template":false,"template_full_name":"codemonument/deno_module_template","purl":"pkg:github/codemonument/deno_sse_codec","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codemonument%2Fdeno_sse_codec","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codemonument%2Fdeno_sse_codec/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codemonument%2Fdeno_sse_codec/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codemonument%2Fdeno_sse_codec/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codemonument","download_url":"https://codeload.github.com/codemonument/deno_sse_codec/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codemonument%2Fdeno_sse_codec/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273548437,"owners_count":25125253,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-04T02:00:08.968Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-25T21:33:34.773Z","updated_at":"2025-12-11T21:15:35.432Z","avatar_url":"https://github.com/codemonument.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SSE Codec\n\nA module which provides encoding \u0026 decoding functionality for SSE Events (Server Sent Events), as well as providing some types.\n\nDeployed to [https://deno.land/x/sse_codec](https://deno.land/x/sse_codec)\n\nCross-Copiled by deno's dnt module and posted to npm as [@codemonument/sse-codec](https://www.npmjs.com/package/@codemonument/sse-codec)\n\n## Imports in Deno\n\n```\n// uses 'latest' version \nimport { encodeSSEEvent } from \"https://deno.land/x/sse_codec\"\n\n// uses a specific version\nimport { encodeSSEEvent } from \"https://deno.land/x/sse_codec@0.2.1\";\n```\n\n## Imports in Node \n\n```\n// install first via npm i -S @codemonument/sse-codec\nimport { encodeSSEEvent } from \"@codemonument/sse-codec\" \n```\n\n## Usage (same in Deno \u0026 Node)\n\nSee the test files for most elaborate usage descriptions. \nHe'res the most important usage information. \n\n### Usage encodeSSEEvent \n\n```\nconst sseString = encodeSSEEvent({\n        name: \"custom-event\",\n        data: \"Some simple string data\",\n        id: \"UID5346324874238475\",\n        retry: 5000,\n      });\n\n```\n\n### Usage SSEStream class\n\n```\n  const sseStream = new SSEStream();\n\n  sseStream.emit({ eventName: \"event1\" });\n  sseStream.emit({ eventName: \"event2\" });\n\n  // Example usage of the sseStream \n  // normally you would not read it yourself \n  // but pass the readable stream to something which uses it for something\n  const reader = sseStream.readableStream.getReader();\n  const chunk1 = await reader.read();\n  const chunk2 = await reader.read();\n\n  console.log(chunk1);\n  console.log(chunk2);\n  \n  // close the sseStream after using it\n  sseStream.end();\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodemonument%2Fdeno_sse_codec","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodemonument%2Fdeno_sse_codec","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodemonument%2Fdeno_sse_codec/lists"}