{"id":14483664,"url":"https://github.com/sergiodxa/swr-sync-storage","last_synced_at":"2025-04-14T06:23:59.981Z","repository":{"id":37863268,"uuid":"244100157","full_name":"sergiodxa/swr-sync-storage","owner":"sergiodxa","description":"Synchronize SWR cache with localStorage or sessionStorage to get offline cache","archived":false,"fork":false,"pushed_at":"2023-01-25T10:01:14.000Z","size":1113,"stargazers_count":110,"open_issues_count":17,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-27T20:12:01.411Z","etag":null,"topics":["localstorage","sessionstorage","swr","swr-sync-storage","web-storage"],"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/sergiodxa.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"patreon":"sergiodxa","github":"sergiodxa","custom":"https://paypal.me/sergiodxa/5"}},"created_at":"2020-03-01T06:38:17.000Z","updated_at":"2025-02-11T21:34:56.000Z","dependencies_parsed_at":"2023-02-14T06:25:15.402Z","dependency_job_id":null,"html_url":"https://github.com/sergiodxa/swr-sync-storage","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sergiodxa%2Fswr-sync-storage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sergiodxa%2Fswr-sync-storage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sergiodxa%2Fswr-sync-storage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sergiodxa%2Fswr-sync-storage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sergiodxa","download_url":"https://codeload.github.com/sergiodxa/swr-sync-storage/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248831410,"owners_count":21168463,"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":["localstorage","sessionstorage","swr","swr-sync-storage","web-storage"],"created_at":"2024-09-03T00:01:57.894Z","updated_at":"2025-04-14T06:23:59.929Z","avatar_url":"https://github.com/sergiodxa.png","language":"TypeScript","funding_links":["https://patreon.com/sergiodxa","https://github.com/sponsors/sergiodxa","https://paypal.me/sergiodxa/5"],"categories":["TypeScript"],"sub_categories":[],"readme":"# swr-sync-storage\n\n![CI](https://github.com/sergiodxa/swr-sync-storage/workflows/CI/badge.svg)\n![Publish](https://github.com/sergiodxa/swr-sync-storage/workflows/Publish/badge.svg)\n[![Maintainability](https://api.codeclimate.com/v1/badges/24f2981243f767aba3e8/maintainability)](https://codeclimate.com/github/sergiodxa/swr-sync-storage/maintainability)\n[![Test Coverage](https://api.codeclimate.com/v1/badges/24f2981243f767aba3e8/test_coverage)](https://codeclimate.com/github/sergiodxa/swr-sync-storage/test_coverage)\n\nSynchronize SWR cache with localStorage or sessionStorage to get offline cache.\n\n## Usage\n\nInstall it\n\n```sh\n$ yarn add swr-sync-storage\n```\n\n\u003e Note: You will need to provide SWR v0.2.0-beta.0 or greater\n\n```ts\nimport { syncWithStorage } from \"swr-sync-storage\";\nsyncWithStorage(\"local\");\nsyncWithStorage(\"session\");\n```\n\nYou can also import to already bound versions of local or session storage.\n\n```ts\nimport { syncWithLocalStorage } from \"swr-sync-storage\";\nsyncWithLocalStorage();\n```\n\n```ts\nimport { syncWithSessionStorage } from \"swr-sync-storage\";\nsyncWithSessionStorage();\n```\n\nEvery function will return a new function to unsubscribe for cache changes.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsergiodxa%2Fswr-sync-storage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsergiodxa%2Fswr-sync-storage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsergiodxa%2Fswr-sync-storage/lists"}