{"id":18447062,"url":"https://github.com/zot/xus","last_synced_at":"2026-02-24T18:39:55.161Z","repository":{"id":664017,"uuid":"307074","full_name":"zot/Xus","owner":"zot","description":"Simple, storage-backed publish and subscribe messaging","archived":false,"fork":false,"pushed_at":"2021-12-07T10:42:55.000Z","size":8086,"stargazers_count":8,"open_issues_count":2,"forks_count":1,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-08T00:34:20.164Z","etag":null,"topics":[],"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/zot.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}},"created_at":"2009-09-14T21:05:52.000Z","updated_at":"2017-12-15T12:47:06.000Z","dependencies_parsed_at":"2022-07-07T18:40:18.129Z","dependency_job_id":null,"html_url":"https://github.com/zot/Xus","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/zot/Xus","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zot%2FXus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zot%2FXus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zot%2FXus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zot%2FXus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zot","download_url":"https://codeload.github.com/zot/Xus/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zot%2FXus/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29795415,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-24T16:37:37.581Z","status":"ssl_error","status_checked_at":"2026-02-24T16:37:37.074Z","response_time":75,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2024-11-06T07:11:51.749Z","updated_at":"2026-02-24T18:39:55.143Z","avatar_url":"https://github.com/zot.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Xus: Simple, storage-backed publish and subscribe messaging\n\nXus provides simple, key-value publish and subscribe with optional storage.\n\n## Key Features\n\n* Easy to use\n* Simple switchboard architecture\n* Simple protocol\n* Small codebase\n* Powerful and flexible\n\n## Easy to use \"xus\" command\n\n* manage Xus instances (start, stop, list, etc.)\n* provides basic access to all operations (get, set, listen, etc.)\n* connects programs for more advanced usage\n* no knowledge of sockets needed\n\n## Simple switchboard architecture\n\n* peers talk to each other through Xus, but Xus is not in control of\n  your program\n* Start your program using the xus command\n* Load JS code into xus, if needed, at startup\n* Plugins are other programs that connect to Xus\n\n## Simple protocol\n\n* Small -- only 6 data commands and 1 server-response command ('error')\n* Commands are newline-terminated JSON arrays\n* Publish/subscribe -- listen on keys and Keys form a tree: a a/b a/b/c\n* Values are persistent -- new subscribers get current values\n* Xus has a metamodel -- Xus acts like a xus plugin; control a peer by changing variables\n\n## Small codebase\n\n* Small JavaScript program/library\n* Runs in both node and browsers\n\n## Powerful and flexible\n\n* Many ways to connect:\n   * local: In-VM\n   * worker: Shared Web Worker\n   * WebSockets\n   * Xus Proxy, running through WebSockets\n* Use data in different ways\n   * published -- publishes changes to subscribers\n   * static -- peers may retrieve values; your in-VM code can reference them\n   * computed -- values may be computed when retrieved\n* Uses JSON values\n\n# Xus command details\n\n* list -- display running xuses\n* sart \u0026lt;server\u003e [-e \u0026lt;module\u003e] [-w \u0026lt;addr\u003e] [-x \u0026lt;cmd\u003e]-- start xus server\n* stop \u0026lt;server\u003e -- kill a xus\n* run cmd arg... -- run command in the context of a xus\n   * ENV contains connection info for spawned commands\n   * fd 3 gets listener results from xus\n   * fd 4 sends to xus\n* listen -- listen for changes \n* get -- get the value of a variable (optionally all of its children)\n* set -- set a variable\n* put -- set a property of a variable's value\n* splice -- splice a variable (if it's an array)\n* removeFirst -- remove first occurrence of a value\n* removeAll -- remove all occurrences of a value\n\n# Protocol Details\n\n* JSON-based (but other encodings are easy to add)\n* key-value model\n   * keys are paths and form a directory-like tree\n      * a/b/c is a \"child\" of a/b\n   * uses JSON values\n* listen to changes for a variable and its children by setting this/listen\n* Commands\n   * value -- get the value of a variable\n   * set -- set the value of a variable\n   * put -- set a property of a variable's object array\n   * splice -- splice a variable's array\n   * removeFirst -- remove first occurrence of a value\n   * removeAll -- remove all occurrences of a value\n   * error -- server sends this to peers when there are errors\n* reflective metamodel\n   * peers have their own variables (peer/\u0026lt;peer-name\u003e/\u0026lt;path\u003e) that can affect Xus\n   * this/\u0026lt;path\u003e -- alias for the current peer's variables\n   * peer/\u0026lt;name\u003e/name -- name of this peer; change the name renames\n     all of the peer's variables (only one peer can be connected with\n     a particular name)\n   * peer/\u0026lt;name\u003e/listen -- array of paths this peer is subscribed to\n   * peer/\u0026lt;name\u003e/master -- set if this peer is the xus master;\n     disconnecting will then shut xus down\n   * peer/\u0026lt;name\u003e/public/\u0026lt;path\u003e -- public variables for a peer; other peers\n     can change these\n\n# Reference Implementation Details\n\nThe JavaScript reference implementation supports the following things\n\n* Values may be functions\n   * When the value is sent, Xus will call the function with no\n     arguments\n   * When the value will be set, Xus will call the function with one\n     argument (value)\n   * When the value is put, Xus will call the function with two\n     arguments (value, index)\n* Objects may behave like arrays should have the following properties:\n   * When the value is sent, Xus will use JSON.stringify, so you may\n     want to define toJSON to return an array for encoding\n   * When the value is spliced, Xus will use splice and length\n   * When the value is used with removeFirst or removeAll, Xus will\n     use splice and indexOf\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzot%2Fxus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzot%2Fxus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzot%2Fxus/lists"}