{"id":19341650,"url":"https://github.com/logux/core","last_synced_at":"2025-04-04T11:07:18.300Z","repository":{"id":40002855,"uuid":"67173777","full_name":"logux/core","owner":"logux","description":"Logux core components for JavaScript","archived":false,"fork":false,"pushed_at":"2024-08-06T21:51:57.000Z","size":3050,"stargazers_count":229,"open_issues_count":0,"forks_count":30,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-03-28T10:01:41.572Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://logux.org/","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/logux.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}},"created_at":"2016-09-01T23:34:26.000Z","updated_at":"2024-11-26T03:31:58.000Z","dependencies_parsed_at":"2023-01-17T17:15:47.896Z","dependency_job_id":"71c6dc2a-a48e-4b0a-bc2a-8b960d9757e5","html_url":"https://github.com/logux/core","commit_stats":{"total_commits":811,"total_committers":21,"mean_commits":38.61904761904762,"dds":0.04932182490752157,"last_synced_commit":"ee42c057d683b6ced2440de08d2f5d502ed35b89"},"previous_names":["logux/logux-core"],"tags_count":31,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logux%2Fcore","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logux%2Fcore/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logux%2Fcore/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logux%2Fcore/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/logux","download_url":"https://codeload.github.com/logux/core/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247159705,"owners_count":20893677,"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":[],"created_at":"2024-11-10T03:31:54.258Z","updated_at":"2025-04-04T11:07:18.276Z","avatar_url":"https://github.com/logux.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Logux Core [![Cult Of Martians][cult-img]][cult]\n\n\u003cimg align=\"right\" width=\"95\" height=\"148\" title=\"Logux logotype\"\n     src=\"https://logux.org/branding/logotype.svg\"\u003e\n\nLogux is a new way to connect client and server. Instead of sending\nHTTP requests (e.g., AJAX and GraphQL) it synchronizes log of operations\nbetween client, server, and other clients.\n\n* **[Guide, recipes, and API](https://logux.org/)**\n* **[Issues](https://github.com/logux/logux/issues)**\n  and **[roadmap](https://github.com/orgs/logux/projects/1)**\n* **[Projects](https://logux.org/guide/architecture/parts/)**\n  inside Logux ecosystem\n\nThis repository contains Logux core components for JavaScript:\n\n* `Log` to store node’s actions.\n* `MemoryStore` to store log in the memory.\n* `BaseNode`, `ClientNode`, and `ServerNode` to synchronize actions\n  from Log with other node.\n* `isFirstOlder` to compare creation time of different actions.\n* `WsConnection`, `Reconnect`, and `ServerConnection` to connect nodes\n  via WebSocket.\n* `TestLog`, `TestPair`, `TestTime`, and `eachStoreCheck`\n  to test Logux application.\n\n\u003ca href=\"https://evilmartians.com/?utm_source=logux-core\"\u003e\n  \u003cimg src=\"https://evilmartians.com/badges/sponsored-by-evil-martians.svg\"\n       alt=\"Sponsored by Evil Martians\" width=\"236\" height=\"54\"\u003e\n\u003c/a\u003e\n\n[cult-img]: http://cultofmartians.com/assets/badges/badge.svg\n[cult]: http://cultofmartians.com/done.html\n\n\n## Install\n\n```sh\nnpm install @logux/core\n```\n\n\n## Usage\n\nSee [documentation] for Logux API.\n\n```js\nimport { ClientNode, TestTime, TestLog, TestPair } from '@logux/core'\n\nlet time = new TestTime()\nlet pair = new TestPair()\nlet node = new ClientNode('client:test', time.nextLog(), pair.left)\n```\n\n```js\nimport { isFirstOlder } from '@logux/core'\n\nlet lastRename\nlog.type('RENAME', (action, meta) =\u003e {\n  if (isFirstOlder(lastRename, meta)) {\n    changeName(action.name)\n    lastRename = meta\n  }\n})\n```\n\n[documentation]: https://logux.org/web-api/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flogux%2Fcore","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flogux%2Fcore","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flogux%2Fcore/lists"}