{"id":21356761,"url":"https://github.com/rousan/comet","last_synced_at":"2025-10-12T22:20:14.917Z","repository":{"id":57203901,"uuid":"173732388","full_name":"rousan/comet","owner":"rousan","description":"A http long polling comet implementation for nodejs and browser","archived":false,"fork":false,"pushed_at":"2019-03-06T15:56:55.000Z","size":261,"stargazers_count":19,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-09-07T07:28:32.716Z","etag":null,"topics":["clinet","comet","http","long-polling","polling","server","websocket"],"latest_commit_sha":null,"homepage":"","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/rousan.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}},"created_at":"2019-03-04T11:29:32.000Z","updated_at":"2025-02-11T21:34:30.000Z","dependencies_parsed_at":"2022-09-17T15:51:08.592Z","dependency_job_id":null,"html_url":"https://github.com/rousan/comet","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/rousan/comet","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rousan%2Fcomet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rousan%2Fcomet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rousan%2Fcomet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rousan%2Fcomet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rousan","download_url":"https://codeload.github.com/rousan/comet/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rousan%2Fcomet/sbom","scorecard":{"id":785529,"data":{"date":"2025-08-11","repo":{"name":"github.com/rousan/comet","commit":"7d911a0e8769521690993f998c5a9cefd1a06e95"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 0/17 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-23T05:59:37.002Z","repository_id":57203901,"created_at":"2025-08-23T05:59:37.002Z","updated_at":"2025-08-23T05:59:37.002Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279013247,"owners_count":26085250,"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-10-12T02:00:06.719Z","response_time":53,"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":["clinet","comet","http","long-polling","polling","server","websocket"],"created_at":"2024-11-22T04:35:53.006Z","updated_at":"2025-10-12T22:20:14.886Z","avatar_url":"https://github.com/rousan.png","language":"JavaScript","readme":"[![NPM version](https://img.shields.io/npm/v/comet.svg)](https://www.npmjs.com/package/comet)\n[![Required Node version](https://img.shields.io/node/v/comet.svg)](https://www.npmjs.com/package/comet)\n[![NPM total downloads](https://img.shields.io/npm/dt/comet.svg)](https://www.npmjs.com/package/comet)\n[![Contributors](https://img.shields.io/github/contributors/rousan/comet.svg)](https://github.com/rousan/comet/graphs/contributors)\n[![License](https://img.shields.io/github/license/rousan/comet.svg)](https://github.com/rousan/comet/blob/master/LICENSE)\n\n# What is http long polling?\n\nHttp long polling is used in real-time application where server pushes the data changes to client using simple HTML5 ajax mechanism.\n\nFirst client makes a request to an HTTP endpoint in the usual way, with the intention of requesting data it has not yet received. If there is no new data available, then the server holds the request open until data becomes available to respond with. After receiving a response (whether new data or timeout), the transaction is complete. The client may create a new request to listen for further data.\n\n# comet\n\nThe comet is a implementation of http long polling or comet application model which abstracts the internal http requests and provides high-level websocket alike API.\n\n## Installation\n\nUsing `npm`:\n\n```bash\n$ npm install --save comet\n```\n\nUsing `yarn`:\n\n```bash\n$ yarn add comet\n```\n\n## Usage\n\nHere is simple example to push n-th fibonacci numbers to client:\n\nThe server:\n\n```javascript\nimport http from 'http';\nimport CometServer from 'comet/server';\n\nconst server = http.createServer();\nconst pollingServer = new CometServer({ server });\n\npollingServer.on('connection', (conn, data) =\u003e {\n  let { fibPos } = data;\n  console.log(`New connection with fibpos: ${fibPos}`);\n\n  setInterval(() =\u003e {\n    conn.send({ pos: fibPos, value: fib(fibPos++) });\n  }, 1000);\n});\n\nserver.listen(8888);\n\nconst fib = (n) =\u003e {\n  let num = 0;\n  let num2 = 1;\n  let fibonacci;\n\n  for (let i = 0; i \u003c n; i++) {\n    fibonacci = num + num2;\n    num = num2;\n    num2 = fibonacci;\n  }\n\n  return num;\n};\n```\n\nThe client:\n\n```javascript\nimport CometClient from 'comet/client';\n\nconst fibPos = Math.floor(Math.random() * 10);\nconst longPollingClient = new CometClient('http://localhost:8888/polling', {\n  data: { fibPos },\n});\n\nlongPollingClient.on('message', (m) =\u003e {\n  console.log(`${m.pos}th: ${m.value}`);\n});\n\nlongPollingClient.on('open', (conn) =\u003e {\n  console.log('Connection opened');\n  console.log(`Receiving fibonacci numbers from ${fibPos}th position:`);\n});\n```\n\nSee `example` for further guide.\n\n## Contributing\n\nYour PRs and stars are always welcome.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frousan%2Fcomet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frousan%2Fcomet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frousan%2Fcomet/lists"}