{"id":19885099,"url":"https://github.com/kefniark/kaaya","last_synced_at":"2026-06-06T13:31:43.452Z","repository":{"id":37927117,"uuid":"213448551","full_name":"kefniark/Kaaya","owner":"kefniark","description":"JS Library for State management and Data synchronization between Applications","archived":false,"fork":false,"pushed_at":"2023-01-07T10:50:13.000Z","size":1381,"stargazers_count":2,"open_issues_count":16,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-15T04:08:18.173Z","etag":null,"topics":["data","game","kaaya","mutation","network","serialization","state-management"],"latest_commit_sha":null,"homepage":"https://kefniark.github.io/Kaaya/samples/","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/kefniark.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-10-07T17:44:31.000Z","updated_at":"2023-06-29T10:27:54.000Z","dependencies_parsed_at":"2023-02-06T23:15:36.385Z","dependency_job_id":null,"html_url":"https://github.com/kefniark/Kaaya","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kefniark%2FKaaya","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kefniark%2FKaaya/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kefniark%2FKaaya/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kefniark%2FKaaya/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kefniark","download_url":"https://codeload.github.com/kefniark/Kaaya/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241313177,"owners_count":19942417,"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":["data","game","kaaya","mutation","network","serialization","state-management"],"created_at":"2024-11-12T17:32:36.329Z","updated_at":"2026-06-06T13:31:43.409Z","avatar_url":"https://github.com/kefniark.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Kaaya\n\nKaaya is a delightful javascript library which target on state management and data synchronization between Applications.\n\n-   **Samples**: [Here](https://kefniark.github.io/Kaaya/samples)\n\n[![Build Status](https://github.com/kefniark/Kaaya/workflows/Build%20CI/badge.svg)](https://github.com/kefniark/Kaaya/actions)\n[![Total alerts](https://img.shields.io/lgtm/alerts/g/kefniark/Kaaya.svg?logo=lgtm\u0026logoWidth=18)](https://lgtm.com/projects/g/kefniark/Kaaya/alerts/)\n[![NPM Version](https://img.shields.io/npm/v/kaaya.svg)](https://npmjs.org/package/kaaya)\n[![NPM Download](https://img.shields.io/npm/dm/kaaya.svg)](https://npmjs.org/package/kaaya)\n[![Coverage Status](https://coveralls.io/repos/github/kefniark/Kaaya/badge.svg?branch=master)](https://coveralls.io/github/kefniark/Kaaya?branch=master)\n[![License](https://img.shields.io/npm/l/kaaya.svg)](https://npmjs.org/package/kaaya)\n\n\u003e Still under development, do not use except for testing\n\n-   Support different data structure (and their usual format):\n    -   **Key Value**: Often used to store configuration (`.ini`, `.yaml`, `.json`)\n    -   **Table**: Data grid like excel (`.csv`, `.yaml`, `.json`)\n    -   **Entities**: List of instantiated object\n    -   **Files**: File/Folder structure (like a file explorer)\n    -   or plain JS object to store your own data\n-   Watch for data modification (mutation)\n-   Keep an history of mutation and allow to replay them on other object\n-   Allow to undo/redo modification\n-   Keep mutation as plain JS object (serializable)\n-   Allow to regroup mutation as transaction (to give context about changes)\n-   Allow to use async hook (for animation or UI interaction)\n\n---\n\n## Usage\n\n### Basic Store Creation\n\n```ts\nimport kaaya from \"kaaya\"\n\n// create a new store with custom data\nconst store = kaaya.createKeyStore({ a: 1, b: 2 })\nstore.data.a = 5\nstore.data.a = 10\n// so far everything looks normal: { a: 10, b: 2 }\n```\n\n### History Management\n\n```ts\n// let's play with the history\nstore.undo()\nstore.data // { a: 5, b: 2 }\n\nstore.undo()\nstore.data // { a: 1, b: 2 }\n\nstore.redo()\nstore.data // { a: 5, b: 2 }\n```\n\n### Synchronization with other store\n\n-   only the history of mutation is send (modification)\n-   can be done over network, file, events, ...\n\n```ts\n// create other store and sync them with our first one data\nconst client1 = kaaya.createKeyStore({ a: 0, b: 6 })\nclient1.sync(store.history)\nclient1.data // \u003c= { a: 5, b: 6 }\n\nconst client2 = kaaya.createKeyStore({ a: 0, b: 8 })\nclient2.sync(store.history)\nclient2.data // \u003c= { a: 5, b: 8 }\n\n// and now let's make a change and progate it\nstore.data.a += 10\nclient1.sync(store.history)\n\nclient1.data // { a: 15, b: 6 } properly sync :)\nclient2.data // { a: 5, b: 8 } not sync yet\n```\n\nAnd more ....\n\n---\n\n## Development\n\n### Getting Started\n\nIf you want to take a look at the code or help, it's quite easy to get started\n\n```sh\nnpm install\nnpm run dev\n```\n\nThis will start a server on http://localhost:8080/ where you can test few samples with the current version\n\n### Tests\n\nWhen you are done with your change, just make sure to run tests `npm run test`\n\n### Build\n\nTo make a build (generated in `build/`)\n\n```sh\nnpm run build\n```\n\n---\n\n## Known Limitation\n\n-   Some array function like `.push` or `.slice` cause the whole object to be mutated and not just the value being changed\n-   Doesnt handle advance object like `Set` or `Map`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkefniark%2Fkaaya","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkefniark%2Fkaaya","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkefniark%2Fkaaya/lists"}