{"id":21060175,"url":"https://github.com/enkot/sse-fake-server","last_synced_at":"2025-05-16T00:34:03.235Z","repository":{"id":57368845,"uuid":"112842862","full_name":"enkot/SSE-Fake-Server","owner":"enkot","description":"SSE Fake Server for testing your code with stream data","archived":false,"fork":false,"pushed_at":"2024-03-06T09:12:43.000Z","size":41,"stargazers_count":5,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-13T21:20:55.863Z","etag":null,"topics":["fake","server","server-sent-events","sse"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/enkot.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2017-12-02T13:07:50.000Z","updated_at":"2025-04-11T02:29:13.000Z","dependencies_parsed_at":"2024-03-06T10:42:57.248Z","dependency_job_id":null,"html_url":"https://github.com/enkot/SSE-Fake-Server","commit_stats":{"total_commits":6,"total_committers":1,"mean_commits":6.0,"dds":0.0,"last_synced_commit":"3ae5ffe638d46b946903be4dbea44549b5d70f9c"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enkot%2FSSE-Fake-Server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enkot%2FSSE-Fake-Server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enkot%2FSSE-Fake-Server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enkot%2FSSE-Fake-Server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/enkot","download_url":"https://codeload.github.com/enkot/SSE-Fake-Server/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254447906,"owners_count":22072755,"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","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":["fake","server","server-sent-events","sse"],"created_at":"2024-11-19T17:15:53.568Z","updated_at":"2025-05-16T00:33:58.217Z","avatar_url":"https://github.com/enkot.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SSE-Fake-Server\nSimple [\"Server Sent Events\"](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events) fake server for testing your code with dynamic data.\n\n## Install\nInstall, using NPM:\n```sh\n$ npm install sse-fake-server\n```\n\n## How to Use\n\n### Server\nJust create \"fakeServer.js\" file:\n```javascript\nconst SSEServer = require('sse-fake-server');\n\n// Pass callback to SSEServer\nSSEServer(client =\u003e {\n    // Every 2 seconds send data to client\n    setInterval(() =\u003e {\n        client.send('Stream Hello!')\n    }, 2000);\n});\n```\nRun it:\n```sh\n$ node fakeServer.js\n```\nNow fake server listen on http://localhost:5555/stream.\n### Client\nSimple SSE usage:\n```html\n\u003c!DOCTYPE html\u003e\n\u003chtml lang=\"en\"\u003e\n\u003chead\u003e\n    \u003cmeta charset=\"UTF-8\"\u003e\n    \u003ctitle\u003eSSE Client\u003c/title\u003e\n\u003c/head\u003e\n\u003cbody\u003e\n    \u003cscript\u003e\n        // Create SSE object\n        var es = new EventSource(\"http://localhost:5555/stream\");\n\n        // Listen for message events from server\n        es.addEventListener('message', function(event) {\n            console.log(event.data);\n        });\n    \u003c/script\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n```\n\n## License\nMIT. © 2017 Taras Batenkov","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fenkot%2Fsse-fake-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fenkot%2Fsse-fake-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fenkot%2Fsse-fake-server/lists"}