{"id":23817813,"url":"https://github.com/lsongdev/server-sent-events","last_synced_at":"2025-08-23T02:17:44.632Z","repository":{"id":68774084,"uuid":"102592176","full_name":"lsongdev/server-sent-events","owner":"lsongdev","description":"server send events library for node.js","archived":false,"fork":false,"pushed_at":"2020-01-09T03:50:12.000Z","size":3,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-19T02:57:53.837Z","etag":null,"topics":["eventsource","http","realtime","server-push","sse"],"latest_commit_sha":null,"homepage":"https://npmjs.org/server-send-events","language":"JavaScript","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/lsongdev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"song940","patreon":"song940","open_collective":"song940","ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":"https://git.io/fjRcB"}},"created_at":"2017-09-06T09:51:00.000Z","updated_at":"2022-12-06T12:01:06.000Z","dependencies_parsed_at":null,"dependency_job_id":"fdd6cad4-744c-4d13-b38d-4bf56e0d6309","html_url":"https://github.com/lsongdev/server-sent-events","commit_stats":null,"previous_names":["song940/server-send-events","lsongdev/server-sent-events"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/lsongdev/server-sent-events","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lsongdev%2Fserver-sent-events","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lsongdev%2Fserver-sent-events/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lsongdev%2Fserver-sent-events/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lsongdev%2Fserver-sent-events/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lsongdev","download_url":"https://codeload.github.com/lsongdev/server-sent-events/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lsongdev%2Fserver-sent-events/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271732362,"owners_count":24811309,"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-08-23T02:00:09.327Z","response_time":69,"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":["eventsource","http","realtime","server-push","sse"],"created_at":"2025-01-02T05:48:48.441Z","updated_at":"2025-08-23T02:17:44.612Z","avatar_url":"https://github.com/lsongdev.png","language":"JavaScript","readme":"## server-send-events\n\n\u003e server send events library for node.js\n\n[![server-send-events](https://img.shields.io/npm/v/server-send-events.svg)](https://npmjs.org/server-send-events)\n\n### Installation\n\n```bash\n$ npm install server-send-events\n```\n\n### Example\n\n```js\nconst http        = require('http');\nconst EventSource = require('server-send-events');\n\nconst es = new EventSource();\nconst server = new http.Server();\nconst send = (res) =\u003e res.end(`\u003cscript\u003e\n  var source = new EventSource('/events');\n  source.onmessage = function(e) {\n    document.body.innerHTML = e.data;\n    console.log(e.data);\n  };\n\u003c/script\u003e`);\n\nserver.on('request', (req, res) =\u003e {\n  if(es.match(req, '/events')){\n    es.handle(req, res);\n  }else{\n    send(res);\n  }\n})\n\nserver.listen(3000, err =\u003e {\n  if(err) throw err;\n  console.log(`server-send-events is running at http://localhost:${server.address().port}`);\n  setInterval(() =\u003e {\n    if(es) es.send(`Current time is : ${new Date().toLocaleString()}`);\n  }, 1000);\n});\n```\n\n### API\n\n- send\n- event\n- retry\n\n### Contributing\n- Fork this Repo first\n- Clone your Repo\n- Install dependencies by `$ npm install`\n- Checkout a feature branch\n- Feel free to add your features\n- Make sure your features are fully tested\n- Publish your local branch, Open a pull request\n- Enjoy hacking \u003c3\n\n### MIT\n\nThis work is licensed under the [MIT license](./LICENSE).\n\n---","funding_links":["https://github.com/sponsors/song940","https://patreon.com/song940","https://opencollective.com/song940","https://git.io/fjRcB"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flsongdev%2Fserver-sent-events","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flsongdev%2Fserver-sent-events","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flsongdev%2Fserver-sent-events/lists"}