{"id":15395800,"url":"https://github.com/mvasilkov/cwb","last_synced_at":"2025-04-16T00:13:49.623Z","repository":{"id":139219156,"uuid":"180804551","full_name":"mvasilkov/cwb","owner":"mvasilkov","description":"Cross-Window Broadcasting and Locking","archived":false,"fork":false,"pushed_at":"2020-02-21T08:55:47.000Z","size":161,"stargazers_count":6,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-16T00:13:44.438Z","etag":null,"topics":["cross-tab-communication","localstorage","locking","mutex","mutex-lock","mutex-synchronisation","typescript"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/cwb","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/mvasilkov.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}},"created_at":"2019-04-11T14:01:49.000Z","updated_at":"2024-10-24T07:27:43.000Z","dependencies_parsed_at":null,"dependency_job_id":"d9ffed25-99e7-4fb7-ada5-9ede2f2023db","html_url":"https://github.com/mvasilkov/cwb","commit_stats":{"total_commits":20,"total_committers":1,"mean_commits":20.0,"dds":0.0,"last_synced_commit":"de6d2d14946bcfcd50c5d86845f5775515c2ae76"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mvasilkov%2Fcwb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mvasilkov%2Fcwb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mvasilkov%2Fcwb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mvasilkov%2Fcwb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mvasilkov","download_url":"https://codeload.github.com/mvasilkov/cwb/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249173086,"owners_count":21224484,"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":["cross-tab-communication","localstorage","locking","mutex","mutex-lock","mutex-synchronisation","typescript"],"created_at":"2024-10-01T15:29:36.131Z","updated_at":"2025-04-16T00:13:49.618Z","avatar_url":"https://github.com/mvasilkov.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"cwb: Cross-Window Broadcasting\n===\n\n**cwb** (pronounced *wub*) is a JavaScript library for cross-window\nbroadcasting and locking.\n\n[![npm][npm-badge]][npm-url]\n[![dependencies][dependencies-badge]][dependencies-url]\n\n---\n\nInstallation\n---\n\n```sh\nnpm add cwb\n```\n\nUsage\n---\n\n### Communicating between tabs\n\n#### Subscribe to events\n\n```javascript\nimport { Channel } from 'cwb'\n\nconst chan = new Channel('foo')\nchan.on('bar', b =\u003e console.log('Got bar:', b))\n```\n\n#### Publish events\n\n```javascript\n/* In another tab */\n\nconst chan = new Channel('foo')\nchan.send('bar', 'Porter and Sons')\n```\n\n#### Send to the same tab\n\n```javascript\nchan.send('bar', 'Porter and Sons', { toSelf: true })\n```\n\n### Locking (synchronization)\n\n```javascript\nimport { lock } from 'cwb'\n\nlock('foo', () =\u003e {\n    /* Critical section. This function can be async. */\n})\n```\n\nChangelog\n---\n\n**1.0.0**\n\nMigrate to TypeScript\n\n**0.0.3**\n\nNew method: `Channel#dispose`\n\n**0.0.2**\n\nNew method: `Channel#update`\n\nLicense\n---\n\nMIT\n\nThe ObjectId type (a vendored dependency) comes from [bson][bson],\nwhich is licensed under the Apache License 2.0\n\n[npm-badge]: https://img.shields.io/npm/v/cwb.svg?style=flat\n[npm-url]: https://www.npmjs.com/package/cwb\n[dependencies-badge]: https://img.shields.io/david/mvasilkov/cwb?style=flat\n[dependencies-url]: https://www.npmjs.com/package/cwb?activeTab=dependencies\n[bson]: https://www.npmjs.com/package/bson\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmvasilkov%2Fcwb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmvasilkov%2Fcwb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmvasilkov%2Fcwb/lists"}