{"id":31796387,"url":"https://github.com/sidwebworks/zen-state","last_synced_at":"2025-10-29T12:33:39.656Z","repository":{"id":60057022,"uuid":"540649521","full_name":"sidwebworks/zen-state","owner":"sidwebworks","description":"Dead simple state-management","archived":false,"fork":false,"pushed_at":"2022-09-24T12:18:16.000Z","size":127,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-29T12:40:25.310Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/sidwebworks.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}},"created_at":"2022-09-23T23:32:26.000Z","updated_at":"2023-03-17T13:17:10.000Z","dependencies_parsed_at":"2022-09-25T18:23:23.760Z","dependency_job_id":null,"html_url":"https://github.com/sidwebworks/zen-state","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/sidwebworks/zen-state","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sidwebworks%2Fzen-state","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sidwebworks%2Fzen-state/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sidwebworks%2Fzen-state/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sidwebworks%2Fzen-state/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sidwebworks","download_url":"https://codeload.github.com/sidwebworks/zen-state/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sidwebworks%2Fzen-state/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279005268,"owners_count":26083864,"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","status":"online","status_checked_at":"2025-10-10T02:00:06.843Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":"2025-10-10T20:48:11.782Z","updated_at":"2025-10-10T20:48:15.364Z","avatar_url":"https://github.com/sidwebworks.png","language":"TypeScript","funding_links":["https://github.com/sponsors/sidwebworks"],"categories":[],"sub_categories":[],"readme":"# Zen\n\n\n[![npm version](https://badgen.net/npm/v/@sidww/zen)](https://npm.im/@sidww/zen) [![npm downloads](https://badgen.net/npm/dm/@sidwebworks/get-packages)](https://npm.im/@sidwebworks/get-packages)\n\n\u003e Dead simple state-management\n\n- 📦 Tiny (less than 1kb)\n- 🔩 Typesafe APIs\n- ⚡️ React and Selectors support\n\n## Install\n\n```bash\nnpm i @sidww/zen\n```\n\n## Usage\n\n```ts\nimport { zen } from \"@sidww/zen\"\n\nconst todos = zen([{ id: 1, completed: false, title: \"Idk man\" }])\n```\n\n### Reading from state\n\n```ts\nconst value = todos.read()\n```\n\n### Writing to state\n\n```ts\ntodos.write([]) // Clear all todos\n\n// Or if the next state depends on previous one\n\ntodos.write((prev) =\u003e [\n  ...prev,\n  { id: 123, title: \"Last one\", completed: true },\n])\n\n// U can also directly use the .read() method instead\n```\n\n### Subscribing to changes\n\n```ts\ntodos.subscribe((state) =\u003e {\n  console.log(\"CHANGE: \", state)\n})\n```\n\n\n### Usage with React\n\n```ts\nimport { useZen } from \"@sidww/zen/react\"\n\nconst todos = useZen(todosZen);\n```\n\n#### Selector support\n\n```ts\nimport { useZen } from \"@sidww/zen/react\"\n\nconst firstTodo = useZen(todosZen, (s) =\u003e s[0]);\n```\n\nType docs: https://paka.dev/npm/@sidww/zen\n\n## Mentions\nStrongly inspired by some of my favourite state libraries [Jotai](https://jotai.org) and [Valtio](https://valtio.pmnd.rs)\n## License\n\nMIT \u0026copy; [sidwebworks](https://github.com/sponsors/sidwebworks)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsidwebworks%2Fzen-state","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsidwebworks%2Fzen-state","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsidwebworks%2Fzen-state/lists"}