{"id":19195324,"url":"https://github.com/fixate/web-storage-proxy","last_synced_at":"2026-04-30T07:41:24.924Z","repository":{"id":68917270,"uuid":"83891296","full_name":"fixate/web-storage-proxy","owner":"fixate","description":"Proxy localstorage and sessionstorage to add serializers and deserializers","archived":false,"fork":false,"pushed_at":"2017-03-06T09:43:13.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-14T12:05:42.591Z","etag":null,"topics":["javascript","nodejs","utility","webstorage"],"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/fixate.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"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,"publiccode":null,"codemeta":null}},"created_at":"2017-03-04T12:19:21.000Z","updated_at":"2017-03-06T09:46:25.000Z","dependencies_parsed_at":null,"dependency_job_id":"48c8a047-16ca-4e6d-b615-03940bf08b78","html_url":"https://github.com/fixate/web-storage-proxy","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/fixate/web-storage-proxy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fixate%2Fweb-storage-proxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fixate%2Fweb-storage-proxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fixate%2Fweb-storage-proxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fixate%2Fweb-storage-proxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fixate","download_url":"https://codeload.github.com/fixate/web-storage-proxy/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fixate%2Fweb-storage-proxy/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259813010,"owners_count":22915198,"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":["javascript","nodejs","utility","webstorage"],"created_at":"2024-11-09T12:09:37.616Z","updated_at":"2026-04-30T07:41:19.905Z","avatar_url":"https://github.com/fixate.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# web-storage-proxy\n\nProxies `getItem` and `setItem` storage apis (e.g. localStorage, sessionStorage) and add in your\nown serializers and deserializers.\n\n## Installation\n\n`npm install --save web-storage-proxy`\n\n## Usage\n\nThe following code will serialize JavaScript objects and store them compressed in localStorage.\n\n```javascript\nconst createStorageProxy = require('web-storage-proxy');\nconst lzString = require('lz-string');\nconst { localStorage } = global;\n\nconst compressedStorage = createStorageProxy({\n  storage: localStorage,\n  serializer: [\n    JSON.stringify,\n    lzString.compress,\n  ],\n\n  deserializer: [\n    lzString.decompress,\n    JSON.parse,\n  ],\n});\n\nconst input = {\n  this: 'is', just: 'an', exmaple: { of: { a: { deeply: { nested: 'object' } } } }\n};\nconsole.log(`Input ${JSON.stringify(input)}`)\ncompressedStorage.setItem('foo', input);\nconsole.log(`Compressed value: ${memStorage.store.foo}`)\n\nconst result = compressedStorage.getItem('foo');\nconsole.log(`Deserialized ${JSON.stringify(result)}`)\n```\n\nPlay with `example.js` to learn more.\n\n\n## Requirements\n\nThis library has no dependencies, however:\n\n- ES6 [Proxy](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy)\nis used. If you are using this in the browser you should include the\n[Proxy polyfill](https://github.com/GoogleChrome/proxy-polyfill).\n\n- `Array.reduce` is used. Modern browsers support this.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffixate%2Fweb-storage-proxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffixate%2Fweb-storage-proxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffixate%2Fweb-storage-proxy/lists"}