{"id":20060381,"url":"https://github.com/cabal-club/cabal-client","last_synced_at":"2025-04-10T02:19:30.546Z","repository":{"id":35093677,"uuid":"135077149","full_name":"cabal-club/cabal-client","owner":"cabal-club","description":"interface for writing peer-to-peer chat clients","archived":false,"fork":false,"pushed_at":"2024-05-15T15:58:28.000Z","size":560,"stargazers_count":97,"open_issues_count":28,"forks_count":14,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-10-29T18:47:56.255Z","etag":null,"topics":["cabal","chat","decentralized","p2p"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cabal-club.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":null,"patreon":null,"open_collective":"cabal-club","ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2018-05-27T19:55:12.000Z","updated_at":"2024-07-15T13:38:19.000Z","dependencies_parsed_at":"2024-01-12T08:48:40.577Z","dependency_job_id":"7c19ee56-c556-4bb3-9c2f-4e6da04db15a","html_url":"https://github.com/cabal-club/cabal-client","commit_stats":{"total_commits":317,"total_committers":15,"mean_commits":"21.133333333333333","dds":"0.34384858044164035","last_synced_commit":"44b5d2ef2de7e2fa4734f55cb82e74a0718d6869"},"previous_names":[],"tags_count":44,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cabal-club%2Fcabal-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cabal-club%2Fcabal-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cabal-club%2Fcabal-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cabal-club%2Fcabal-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cabal-club","download_url":"https://codeload.github.com/cabal-club/cabal-client/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248142908,"owners_count":21054672,"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":["cabal","chat","decentralized","p2p"],"created_at":"2024-11-13T13:14:16.758Z","updated_at":"2025-04-10T02:19:30.527Z","avatar_url":"https://github.com/cabal-club.png","language":"JavaScript","funding_links":["https://opencollective.com/cabal-club"],"categories":[],"sub_categories":[],"readme":"# cabal-client\n\n`cabal-client` is a new type of client library for cabal chat clients.\n\nNew chat clients can be implemented using _only_ this library, without having\nto mess around with [`cabal-core`](https://github.com/cabal-club/cabal-core/)\nanymore.\n\nSome of its features:\n\n- consolidates logic common to all chat clients\n- leaving and joining of channels\n- virtual messages (such as status messages) and virtual channels (currently only the `!status` channel)\n- handling multiple cabal instances\n- receiving unread notifications and mentions for channels\n- resolving of DNS shortnames (cabal.chat) to cabal keys\n\nFor a couple of brief examples, see the [`examples/`](examples/) directory.\n\n## Usage\n\nSee [`cabal-cli`](https://github.com/cabal-club/cabal-cli/) for an example client implementation.\n\n[Read the API documentation](./api.md)\n\n```js\nvar Client = require('cabal-client')\n\nconst client = new Client({\n  config: {\n    dbdir: '/tmp/cabals'\n  }\n})\n\nclient.createCabal()\n  .then((cabal) =\u003e {\n    // resolves when the cabal is ready, returns a CabalDetails instance\n  })\n```\n\n## Concepts\n\n`cabal-client` has **three core abstractions**:\n[`Client`](https://github.com/cabal-club/cabal-client/blob/master/src/client.js),\n[`CabalDetails`](https://github.com/cabal-club/cabal-client/blob/master/src/cabal-details.js) and\n[`ChannelDetails`](https://github.com/cabal-club/cabal-client/blob/master/src/channel-details.js).\n\n[`Client`](https://github.com/cabal-club/cabal-client/blob/master/src/client.js) is the\nentrypoint. It has a list of `CabalDetails` (one `details` for each joined cabal) as well as an API for interacting with\na cabal (getting a count of the new messages for a channel, the joined channels for the current peer etc).\n\n[`CabalDetails`](https://github.com/cabal-club/cabal-client/blob/master/src/cabal-details.js) is the\ninstance that clients mostly operate on, as it encapsulates all information for a particular cabal. (joined channels,\nusers in that channel, the topic). **It also emits events.**\n\nWhen a change has happened, a `CabalDetails` instance will call `this._emitUpdate()`. When a client receives this\nevent, they should update their state \u0026 rerender. (Check out [how the cli does\nit](https://github.com/cabal-club/cabal-cli/pull/126).)\n\n[`ChannelDetails`](https://github.com/cabal-club/cabal-client/blob/master/src/channel-details.js)\nencapsulates everything channels (mentions in that channel, status messages for the channel (like having called a\ncommand eg `/names`, when it was last read, if it's currently being viewed, if it's joined and so on). It also has a\nbarebones implementation for virtual channels, which currently is only the `!status` channel.\n\n## Install\n\nWith [npm](https://npmjs.org/) installed, run\n\n```\n$ npm install cabal-client\n```\n\n## Developing\n\n### Changelog\n\nSee the instructions for generating the changelog in the [cabal-core readme](https://github.com/cabal-club/cabal-core/#developing).\n\n## License\n\nAGPL-3.0-or-later\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcabal-club%2Fcabal-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcabal-club%2Fcabal-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcabal-club%2Fcabal-client/lists"}