{"id":38095752,"url":"https://github.com/frectonz/leader-tab","last_synced_at":"2026-01-18T02:15:01.162Z","repository":{"id":287952363,"uuid":"966342279","full_name":"frectonz/leader-tab","owner":"frectonz","description":"An algorithm for selecting a leader from all the open tabs of a website.","archived":false,"fork":false,"pushed_at":"2025-04-15T15:03:41.000Z","size":105,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-17T06:48:16.735Z","etag":null,"topics":["distributed-systems","leader-election"],"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/frectonz.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,"zenodo":null}},"created_at":"2025-04-14T19:21:56.000Z","updated_at":"2025-04-17T18:11:40.000Z","dependencies_parsed_at":"2025-04-14T20:44:22.146Z","dependency_job_id":null,"html_url":"https://github.com/frectonz/leader-tab","commit_stats":null,"previous_names":["frectonz/leader-tab"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/frectonz/leader-tab","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frectonz%2Fleader-tab","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frectonz%2Fleader-tab/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frectonz%2Fleader-tab/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frectonz%2Fleader-tab/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/frectonz","download_url":"https://codeload.github.com/frectonz/leader-tab/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frectonz%2Fleader-tab/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28526569,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T00:39:45.795Z","status":"online","status_checked_at":"2026-01-18T02:00:07.578Z","response_time":98,"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":["distributed-systems","leader-election"],"created_at":"2026-01-16T21:03:01.225Z","updated_at":"2026-01-18T02:15:01.130Z","avatar_url":"https://github.com/frectonz.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `leader-tab`\n\nAn algorithm for selecting a leader from all the open tabs of a website. Uses the [Broadcast Channel](https://developer.mozilla.org/en-US/docs/Web/API/Broadcast_Channel_API) API for synchronization.\n\n```typescript\nimport { elector } from \"leader-tab\";\n\nconst tab = elector({\n  onLeaderElected: () =\u003e {\n    console.log(\"I am the leader\");\n  },\n  onLeaderDemoted: () =\u003e {\n    console.log(\"I got demoted\");\n  },\n});\n\nconsole.log(\"Current tab id\", tab.getTabId());\nconsole.log(\"Is current tab the leader\", tab.isLeader());\nconsole.log(\"Stop all synchronization work\", tab.destroy());\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrectonz%2Fleader-tab","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffrectonz%2Fleader-tab","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrectonz%2Fleader-tab/lists"}