{"id":19196653,"url":"https://github.com/steveswork/universal-storage","last_synced_at":"2026-06-13T01:32:41.356Z","repository":{"id":226359045,"uuid":"768485732","full_name":"steveswork/universal-storage","owner":"steveswork","description":null,"archived":false,"fork":false,"pushed_at":"2024-03-14T00:45:31.000Z","size":430,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-06-13T01:32:39.697Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/steveswork.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":null,"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},"funding":{"custom":["https://www.paypal.me/webKrafters"]}},"created_at":"2024-03-07T07:06:55.000Z","updated_at":"2024-03-07T07:09:36.000Z","dependencies_parsed_at":"2024-03-14T01:32:01.161Z","dependency_job_id":null,"html_url":"https://github.com/steveswork/universal-storage","commit_stats":null,"previous_names":["steveswork/universal-storage"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/steveswork/universal-storage","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steveswork%2Funiversal-storage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steveswork%2Funiversal-storage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steveswork%2Funiversal-storage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steveswork%2Funiversal-storage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/steveswork","download_url":"https://codeload.github.com/steveswork/universal-storage/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steveswork%2Funiversal-storage/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34269363,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-12T02:00:06.859Z","response_time":109,"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":"2024-11-09T12:14:13.298Z","updated_at":"2026-06-13T01:32:41.334Z","avatar_url":"https://github.com/steveswork.png","language":"JavaScript","funding_links":["https://www.paypal.me/webKrafters"],"categories":[],"sub_categories":[],"readme":"# Universal Storage\nA persistent client-server coordinated storage based on client domain cookies with a local-storage fallback.\n\n### Name:\n\u003cstrong\u003euniversal-storage\u003c/strong\u003e\n\n# Installation\nnpm install --save universal-storage\n\n# Usage\n\n### In client-side code.\n\n```jsx\nimport { discardClientStorage, getClientStorage } from 'universal-storage';\n\nlet storage = getClientStorage(); // establishes a client storage singleton\n\nstorage.current.setItem( 'key', 'value' );\nstorage.current.getItem( 'key' ); // 'value'\nstorage.current.removeItem( 'key' );\n\nstorage.current.getItem( 'key' ); // undefined\nstorage.current.setItem( 'key', 'value2' );\nstorage.current.getItem( 'key' ); // 'value2'\n\ndiscardClientStorage(); // destroys the current client storage singleton\n\nstorage.current.getItem( 'key' ); // error! cannot read getItem of undefined; reading 'storage.current'\n\nstorage = getClientStorage(); // reestablishes a client storage singleton\n\nstorage.current.getItem( 'key' ); // 'value2' \n```\n\n### In server-side code.\n\n```jsx\nimport { discardServerStorage, getServerStorage } from 'universal-storage';\n\nlet storage = getServerStorage(); // establishes a client storage singleton\n\nstorage.current.setItem( 'key', 'value', e.response );\nstorage.current.getItem( 'key', e.request ); // 'value'\nstorage.current.removeItem( 'key', 'value', e.response );\n\nstorage.current.getItem( 'key', e.request ); // undefined\nstorage.current.setItem( 'key', 'value2', e.response );\nstorage.current.getItem( 'key', e.request ); // 'value2'\n\ndiscardServerStorage(); // destroys the current client storage singleton\n\nstorage.current.getItem( 'key', e.request ); // error! cannot read getItem of undefined; reading 'storage.current'\n\nstorage = getServerStorage(); // reestablishes a client storage singleton\n\nstorage.current.getItem( 'key', e.request ); // 'value2' \n```\n\n# License\nMIT\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsteveswork%2Funiversal-storage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsteveswork%2Funiversal-storage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsteveswork%2Funiversal-storage/lists"}