{"_id":"svelte-persisted-state","_rev":"8-7f26ef0428f33b91a5c7b052af648349","name":"svelte-persisted-state","dist-tags":{"latest":"1.4.1"},"versions":{"0.0.1":{"name":"svelte-persisted-state","version":"0.0.1","license":"MIT","_id":"svelte-persisted-state@0.0.1","maintainers":[{"name":"i_am_o","email":"omar@ojoa.dev"}],"dist":{"shasum":"795e29b3333387d24feb4872fa648ddb9265a46d","tarball":"https://registry.npmjs.org/svelte-persisted-state/-/svelte-persisted-state-0.0.1.tgz","fileCount":4,"integrity":"sha512-IhlNI6je3G8Sa0x66PWOKH0hWVPHDy1a/BWTMhpAak2pWvE7hr2X1pd7QM+fU7Tb9x4QQND3wW7hMUN3SPlsuQ==","signatures":[{"sig":"MEYCIQClq72mzj6L8tm4s829XCsWg+urjAupWNDDwSKUDGUZRwIhAOTvk+Y3ZBNDmJ9ecL5OULpc80nPWEr//Ur+vCIEZTtq","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":7969},"type":"module","types":"./dist/index.svelte.d.ts","svelte":"./dist/index.svelte.js","exports":{".":{"types":"./dist/index.svelte.d.ts","svelte":"./dist/index.svelte.js"}},"gitHead":"50228092ae32bf85df5721da0a052cc84f0a686c","scripts":{"dev":"vite dev","lint":"prettier --check . && eslint .","test":"vitest","build":"vite build && npm run package","check":"svelte-kit sync && svelte-check --tsconfig ./tsconfig.json","format":"prettier --write .","package":"svelte-kit sync && svelte-package && publint","preview":"vite preview","check:watch":"svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch","prepublishOnly":"npm run package"},"_npmUser":{"name":"i_am_o","email":"omar@ojoa.dev"},"_npmVersion":"10.8.2","description":"Svelte 5 persisted states, [svelte-persisted-store](https://github.com/joshnuss/svelte-persisted-store), but implemented with Svelte 5 Runes.","directories":{},"_nodeVersion":"20.17.0","_hasShrinkwrap":false,"devDependencies":{"vite":"^5.4.8","jsdom":"^25.0.1","tslib":"^2.7.0","eslint":"^9.11.1","svelte":"^5.0.0-next.260","vitest":"^2.1.1","globals":"^15.9.0","publint":"^0.1.16","prettier":"^3.3.3","typescript":"^5.6.2","svelte-check":"^3.8.6","@sveltejs/kit":"^2.6.1","@types/eslint":"^8.56.12","@sveltejs/package":"^2.3.5","typescript-eslint":"^8.7.0","eslint-plugin-svelte":"^2.44.1","@sveltejs/adapter-auto":"^3.2.5","eslint-config-prettier":"^9.1.0","prettier-plugin-svelte":"^3.2.7","@sveltejs/vite-plugin-svelte":"^4.0.0-next.7"},"peerDependencies":{"svelte":"^5.0.0-next.1"},"_npmOperationalInternal":{"tmp":"tmp/svelte-persisted-state_0.0.1_1727548530972_0.06736076794416257","host":"s3://npm-registry-packages"}},"0.1.0":{"name":"svelte-persisted-state","version":"0.1.0","keywords":["svelte","localstorage","sessionstorage","persisted","state"],"license":"MIT","_id":"svelte-persisted-state@0.1.0","maintainers":[{"name":"i_am_o","email":"omar@ojoa.dev"}],"homepage":"https://github.com/oMaN-Rod/svelte-persisted-state#readme","bugs":{"url":"https://github.com/oMaN-Rod/svelte-persisted-state/issues"},"dist":{"shasum":"b746e69f71b6cc01499b42dcd893561c3cbfb9a4","tarball":"https://registry.npmjs.org/svelte-persisted-state/-/svelte-persisted-state-0.1.0.tgz","fileCount":5,"integrity":"sha512-YgqKkEFY8NXBL2kAcSTClV0IIjM99VHNrd/7jHzFczQx+mr07jJslhNVCpNfr3MmlBgmkaXGV+v02wrA3bFvOw==","signatures":[{"sig":"MEYCIQCRN1TZm7ZwbeehzeB3LIk8NcI4ZR5/VsDZAu94TD0HewIhANdx2D0jq/sV4bsitLeY1EsEFzlLYLY2Sxep83YCWkGZ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":10517},"type":"module","types":"./dist/index.svelte.d.ts","svelte":"./dist/index.svelte.js","exports":{".":{"types":"./dist/index.svelte.d.ts","svelte":"./dist/index.svelte.js"}},"gitHead":"27a12c41e03841c5522fcdd1bfc8da40a0f12bca","scripts":{"dev":"vite dev","lint":"prettier --check . && eslint .","test":"vitest","build":"vite build && npm run package","check":"svelte-kit sync && svelte-check --tsconfig ./tsconfig.json","format":"prettier --write .","package":"svelte-kit sync && svelte-package && publint","preview":"vite preview","check:watch":"svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch","prepublishOnly":"npm run package"},"_npmUser":{"name":"i_am_o","email":"omar@ojoa.dev"},"repository":{"url":"git+https://github.com/oMaN-Rod/svelte-persisted-state.git","type":"git"},"_npmVersion":"10.8.2","description":"Svelte 5 persisted states, [svelte-persisted-store](https://github.com/joshnuss/svelte-persisted-store), but implemented with Svelte 5 Runes.","directories":{},"_nodeVersion":"20.17.0","_hasShrinkwrap":false,"devDependencies":{"vite":"^5.4.10","jsdom":"^25.0.1","tslib":"^2.8.0","eslint":"^9.13.0","svelte":"^5.1.3","vitest":"^2.1.3","globals":"^15.11.0","publint":"^0.2.12","prettier":"^3.3.3","typescript":"^5.6.3","svelte-check":"^4.0.5","@sveltejs/kit":"^2.7.3","@types/eslint":"^9.6.1","semantic-release":"^24.2.0","@sveltejs/package":"^2.3.7","typescript-eslint":"^8.11.0","eslint-plugin-svelte":"^2.46.0","@sveltejs/adapter-auto":"^3.3.1","eslint-config-prettier":"^9.1.0","prettier-plugin-svelte":"^3.2.7","@sveltejs/vite-plugin-svelte":"^4.0.0"},"peerDependencies":{"svelte":"^5.0.0-next.1"},"_npmOperationalInternal":{"tmp":"tmp/svelte-persisted-state_0.1.0_1730029171253_0.2542236609550388","host":"s3://npm-registry-packages"}},"1.0.0":{"name":"svelte-persisted-state","version":"1.0.0","keywords":["svelte","localstorage","sessionstorage","persisted","state"],"license":"MIT","_id":"svelte-persisted-state@1.0.0","maintainers":[{"name":"i_am_o","email":"omar@ojoa.dev"}],"homepage":"https://github.com/oMaN-Rod/svelte-persisted-state#readme","bugs":{"url":"https://github.com/oMaN-Rod/svelte-persisted-state/issues"},"dist":{"shasum":"0060295d6877fdc46465ae8b78340923bf26f6ed","tarball":"https://registry.npmjs.org/svelte-persisted-state/-/svelte-persisted-state-1.0.0.tgz","fileCount":5,"integrity":"sha512-+yVknmQULtlJ1Q0UOmtICPnUpyoIvtON9q+WGMkbXBcFT/2QeMdynsmgZL/T+C40IegmTMZyr+oGZhyaiL+jgQ==","signatures":[{"sig":"MEYCIQCrJ0KVpqXPMk4xC3ZhVslXnqanQIZCJYkJfnK/RZvAswIhAOVNPq50GanOWFG+xDKzE0xMbMxoCuLpK5rY5U9TV5Uh","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":9138},"type":"module","types":"./dist/index.svelte.d.ts","svelte":"./dist/index.svelte.js","exports":{".":{"types":"./dist/index.svelte.d.ts","svelte":"./dist/index.svelte.js"}},"gitHead":"2da4497eeb8f6bb76ddd36caa84ad4475011bdb0","scripts":{"dev":"vite dev","lint":"prettier --check . && eslint .","test":"vitest","build":"vite build && npm run package","check":"svelte-kit sync && svelte-check --tsconfig ./tsconfig.json","format":"prettier --write .","package":"svelte-kit sync && svelte-package && publint","preview":"vite preview","check:watch":"svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch","prepublishOnly":"npm run package"},"_npmUser":{"name":"i_am_o","email":"omar@ojoa.dev"},"repository":{"url":"git+https://github.com/oMaN-Rod/svelte-persisted-state.git","type":"git"},"_npmVersion":"10.8.3","description":"Svelte 5 persisted states, [svelte-persisted-store](https://github.com/joshnuss/svelte-persisted-store), but implemented with Svelte 5 Runes.","directories":{},"_nodeVersion":"22.13.1","_hasShrinkwrap":false,"devDependencies":{"vite":"^5.4.10","jsdom":"^25.0.1","tslib":"^2.8.1","eslint":"^9.13.0","svelte":"^5.16.0","vitest":"^2.1.6","globals":"^15.11.0","publint":"^0.2.12","prettier":"^3.3.3","typescript":"^5.6.3","svelte-check":"^4.0.5","@sveltejs/kit":"^2.15.1","@types/eslint":"^9.6.1","semantic-release":"^24.2.0","@sveltejs/package":"^2.3.7","typescript-eslint":"^8.19.0","eslint-plugin-svelte":"^2.46.0","@sveltejs/adapter-auto":"^3.3.1","eslint-config-prettier":"^9.1.0","prettier-plugin-svelte":"^3.2.7","@sveltejs/vite-plugin-svelte":"^4.0.4"},"peerDependencies":{"svelte":"^5.0.0-next.1"},"_npmOperationalInternal":{"tmp":"tmp/svelte-persisted-state_1.0.0_1738411232914_0.8891234445216405","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"svelte-persisted-state","version":"1.1.0","keywords":["svelte","localstorage","sessionstorage","persisted","state"],"license":"MIT","_id":"svelte-persisted-state@1.1.0","maintainers":[{"name":"i_am_o","email":"omar@ojoa.dev"}],"homepage":"https://github.com/oMaN-Rod/svelte-persisted-state#readme","bugs":{"url":"https://github.com/oMaN-Rod/svelte-persisted-state/issues"},"dist":{"shasum":"91c57d277bacab19d4a6f09f295ecde0f3a28e99","tarball":"https://registry.npmjs.org/svelte-persisted-state/-/svelte-persisted-state-1.1.0.tgz","fileCount":5,"integrity":"sha512-wzzx69XtfqmW2jiu9FghLhYja3T9hcPZ0TS67E1jMKaURQy2Imoi62RIqse7ZQ5pNqIuiRNF4JAmS5Z364214w==","signatures":[{"sig":"MEQCIA6IfAj9xYjd83uy7swFir6uA6rin0xC03G/nggczcN/AiB98zwqhVZ4YI4jmm0zkOY2W4QViwYt0Oy67j5K8Lz+vA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":13508},"type":"module","types":"./dist/index.svelte.d.ts","svelte":"./dist/index.svelte.js","exports":{".":{"types":"./dist/index.svelte.d.ts","svelte":"./dist/index.svelte.js"}},"gitHead":"46150ea63b4c92d820a415f6b6a00607b9706822","scripts":{"dev":"vite dev","lint":"prettier --check . && eslint .","test":"vitest","build":"vite build && npm run package","check":"svelte-kit sync && svelte-check --tsconfig ./tsconfig.json","format":"prettier --write .","package":"svelte-kit sync && svelte-package && publint","preview":"vite preview","check:watch":"svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch","prepublishOnly":"npm run package"},"_npmUser":{"name":"i_am_o","email":"omar@ojoa.dev"},"repository":{"url":"git+https://github.com/oMaN-Rod/svelte-persisted-state.git","type":"git"},"_npmVersion":"10.8.3","description":"Svelte 5 persisted states, [svelte-persisted-store](https://github.com/joshnuss/svelte-persisted-store), but implemented with Svelte 5 Runes.","directories":{},"_nodeVersion":"22.15.0","_hasShrinkwrap":false,"devDependencies":{"vite":"^5.4.10","jsdom":"^25.0.1","tslib":"^2.8.1","eslint":"^9.13.0","svelte":"^5.16.0","vitest":"^2.1.6","globals":"^15.11.0","publint":"^0.2.12","prettier":"^3.3.3","typescript":"^5.6.3","svelte-check":"^4.0.5","@sveltejs/kit":"^2.15.1","@types/eslint":"^9.6.1","semantic-release":"^24.2.0","@sveltejs/package":"^2.3.7","typescript-eslint":"^8.19.0","eslint-plugin-svelte":"^2.46.0","@sveltejs/adapter-auto":"^3.3.1","eslint-config-prettier":"^9.1.0","prettier-plugin-svelte":"^3.2.7","@sveltejs/vite-plugin-svelte":"^4.0.4"},"peerDependencies":{"svelte":"^5.0.0-next.1"},"_npmOperationalInternal":{"tmp":"tmp/svelte-persisted-state_1.1.0_1749078186937_0.9037711209910877","host":"s3://npm-registry-packages-npm-production"}},"1.2.0":{"name":"svelte-persisted-state","version":"1.2.0","keywords":["svelte","localstorage","sessionstorage","persisted","state"],"license":"MIT","_id":"svelte-persisted-state@1.2.0","maintainers":[{"name":"i_am_o","email":"omar@ojoa.dev"}],"homepage":"https://github.com/oMaN-Rod/svelte-persisted-state#readme","bugs":{"url":"https://github.com/oMaN-Rod/svelte-persisted-state/issues"},"dist":{"shasum":"4f2d5fc35673ff110cb211abaa6d878b93ec4870","tarball":"https://registry.npmjs.org/svelte-persisted-state/-/svelte-persisted-state-1.2.0.tgz","fileCount":5,"integrity":"sha512-zNPfLNH3vG/e0JXYU+rEkDNXnD8OhE5IzJfMnWIFYRxOcg1Ngc0x5uP4RdJKUdRsVjNLL6zBYPiQdzrYbxLoMQ==","signatures":[{"sig":"MEUCIQDBCubb0i7wqaQw7O3WO4icp+wYMZBmMEQC15w1eXXJEQIgeJcYBx/+f+GBcyKsicgns2BSXQMuQTjJZUIR3eWqz5o=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":17100},"type":"module","types":"./dist/index.svelte.d.ts","svelte":"./dist/index.svelte.js","exports":{".":{"types":"./dist/index.svelte.d.ts","svelte":"./dist/index.svelte.js"}},"gitHead":"459066416133adb80eafd867b046a768a86999a8","scripts":{"dev":"vite dev","lint":"prettier --check . && eslint .","test":"vitest","build":"vite build && npm run package","check":"svelte-kit sync && svelte-check --tsconfig ./tsconfig.json","format":"prettier --write .","package":"svelte-kit sync && svelte-package && publint","preview":"vite preview","check:watch":"svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch","prepublishOnly":"npm run package"},"_npmUser":{"name":"i_am_o","email":"omar@ojoa.dev"},"repository":{"url":"git+https://github.com/oMaN-Rod/svelte-persisted-state.git","type":"git"},"_npmVersion":"10.8.3","description":"Svelte 5 persisted states, [svelte-persisted-store](https://github.com/joshnuss/svelte-persisted-store), but implemented with Svelte 5 Runes.","directories":{},"_nodeVersion":"22.15.0","_hasShrinkwrap":false,"devDependencies":{"vite":"^5.4.10","jsdom":"^25.0.1","tslib":"^2.8.1","eslint":"^9.13.0","svelte":"^5.16.0","vitest":"^2.1.6","globals":"^15.11.0","publint":"^0.2.12","prettier":"^3.3.3","typescript":"^5.6.3","svelte-check":"^4.0.5","@sveltejs/kit":"^2.15.1","@types/eslint":"^9.6.1","semantic-release":"^24.2.0","@sveltejs/package":"^2.3.7","typescript-eslint":"^8.19.0","eslint-plugin-svelte":"^2.46.0","@sveltejs/adapter-auto":"^3.3.1","eslint-config-prettier":"^9.1.0","prettier-plugin-svelte":"^3.2.7","@sveltejs/vite-plugin-svelte":"^4.0.4"},"peerDependencies":{"svelte":"^5.0.0-next.1"},"_npmOperationalInternal":{"tmp":"tmp/svelte-persisted-state_1.2.0_1749390920964_0.5236381687039364","host":"s3://npm-registry-packages-npm-production"}},"1.3.0":{"name":"svelte-persisted-state","version":"1.3.0","keywords":["svelte","localstorage","sessionstorage","persisted","state"],"license":"MIT","_id":"svelte-persisted-state@1.3.0","maintainers":[{"name":"i_am_o","email":"omar@ojoa.dev"}],"homepage":"https://github.com/oMaN-Rod/svelte-persisted-state#readme","bugs":{"url":"https://github.com/oMaN-Rod/svelte-persisted-state/issues"},"dist":{"shasum":"637b74b0408fa52c5b1f443475a61b33a93d8908","tarball":"https://registry.npmjs.org/svelte-persisted-state/-/svelte-persisted-state-1.3.0.tgz","fileCount":7,"integrity":"sha512-xxoxtXieuxSbklYh6ZOdhU9Uo3lP5nAZmOeyFsZBDpuEm9hkZG5M4Z7U2dzVtUBeg8ienZyUZIvsxN5laFNL4A==","signatures":[{"sig":"MEQCIE57/WMFCWFADcGjOUiggjWMF8FJFCZViAa161gN3f1cAiBUB/SMDQLvHkJgMDLED8UwTfteBWA9+fEWlh+f30nMag==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":28075},"type":"module","types":"./dist/index.svelte.d.ts","svelte":"./dist/index.svelte.js","exports":{".":{"types":"./dist/index.svelte.d.ts","svelte":"./dist/index.svelte.js"}},"gitHead":"acf40e1ad3a07408f28bdcece259e78f9b154cfc","scripts":{"dev":"vite dev","lint":"prettier --check . && eslint .","test":"vitest","build":"vite build && npm run package","check":"svelte-kit sync && svelte-check --tsconfig ./tsconfig.json","format":"prettier --write .","package":"svelte-kit sync && svelte-package && publint","preview":"vite preview","check:watch":"svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch","prepublishOnly":"npm run package"},"_npmUser":{"name":"i_am_o","email":"omar@ojoa.dev"},"repository":{"url":"git+https://github.com/oMaN-Rod/svelte-persisted-state.git","type":"git"},"_npmVersion":"10.9.3","description":"Svelte 5 persisted states, [svelte-persisted-store](https://github.com/joshnuss/svelte-persisted-store), but implemented with Svelte 5 Runes.","directories":{},"_nodeVersion":"24.13.0","_hasShrinkwrap":false,"devDependencies":{"vite":"^5.4.19","jsdom":"^25.0.1","tslib":"^2.8.1","eslint":"^9.34.0","svelte":"^5.38.6","vitest":"^2.1.9","globals":"^15.15.0","publint":"^0.2.12","prettier":"^3.6.2","typescript":"^5.9.2","svelte-check":"^4.3.1","@sveltejs/kit":"^2.37.0","@types/eslint":"^9.6.1","fake-indexeddb":"^6.0.0","semantic-release":"^24.2.7","@sveltejs/package":"^2.5.0","typescript-eslint":"^8.42.0","eslint-plugin-svelte":"^2.46.1","@sveltejs/adapter-auto":"^3.3.1","eslint-config-prettier":"^9.1.2","prettier-plugin-svelte":"^3.4.0","@sveltejs/vite-plugin-svelte":"^4.0.4"},"peerDependencies":{"svelte":"^5.0.0-next.1"},"_npmOperationalInternal":{"tmp":"tmp/svelte-persisted-state_1.3.0_1769917700389_0.8626622606738035","host":"s3://npm-registry-packages-npm-production"}},"1.4.0":{"name":"svelte-persisted-state","version":"1.4.0","keywords":["svelte","localstorage","sessionstorage","persisted","state"],"license":"MIT","_id":"svelte-persisted-state@1.4.0","maintainers":[{"name":"i_am_o","email":"omar@ojoa.dev"}],"homepage":"https://github.com/oMaN-Rod/svelte-persisted-state#readme","bugs":{"url":"https://github.com/oMaN-Rod/svelte-persisted-state/issues"},"dist":{"shasum":"16c46b7898ce17d14a15155a62b6d95d5e26d9a1","tarball":"https://registry.npmjs.org/svelte-persisted-state/-/svelte-persisted-state-1.4.0.tgz","fileCount":7,"integrity":"sha512-xww7xmh9U+1WoBFPqMfXraZHADirggSm88KxB2pgw4rpMDwj7VPwXcGNeaxxPN3pw1+86EFqxF654S84G0yGfw==","signatures":[{"sig":"MEQCIDh25+/IWT5bNscVQC0lQ8NVB75mi+ZOC+Qg0+OJ2nCbAiBl3tdXFLvQWaZuTQzOhbRhVTMJYNEp7JBvDwze1eC6JQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":29626},"type":"module","types":"./dist/index.svelte.d.ts","svelte":"./dist/index.svelte.js","exports":{".":{"types":"./dist/index.svelte.d.ts","svelte":"./dist/index.svelte.js"}},"gitHead":"b203ccf44e404efcd0630f40913a75a4b9e348dd","scripts":{"dev":"vite dev","lint":"prettier --check . && eslint .","test":"vitest","build":"vite build && npm run package","check":"svelte-kit sync && svelte-check --tsconfig ./tsconfig.json","format":"prettier --write .","package":"svelte-kit sync && svelte-package && publint","preview":"vite preview","check:watch":"svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch","prepublishOnly":"npm run package"},"_npmUser":{"name":"i_am_o","email":"omar@ojoa.dev"},"repository":{"url":"git+https://github.com/oMaN-Rod/svelte-persisted-state.git","type":"git"},"_npmVersion":"10.9.3","description":"Svelte 5 persisted states, [svelte-persisted-store](https://github.com/joshnuss/svelte-persisted-store), but implemented with Svelte 5 Runes.","directories":{},"_nodeVersion":"24.13.0","_hasShrinkwrap":false,"devDependencies":{"vite":"^5.4.19","jsdom":"^25.0.1","tslib":"^2.8.1","eslint":"^9.34.0","svelte":"^5.38.6","vitest":"^2.1.9","globals":"^15.15.0","publint":"^0.2.12","prettier":"^3.6.2","typescript":"^5.9.2","svelte-check":"^4.3.1","@sveltejs/kit":"^2.37.0","@types/eslint":"^9.6.1","fake-indexeddb":"^6.0.0","semantic-release":"^24.2.7","@sveltejs/package":"^2.5.0","typescript-eslint":"^8.42.0","eslint-plugin-svelte":"^2.46.1","@sveltejs/adapter-auto":"^3.3.1","eslint-config-prettier":"^9.1.2","prettier-plugin-svelte":"^3.4.0","@sveltejs/vite-plugin-svelte":"^4.0.4"},"peerDependencies":{"svelte":"^5.0.0-next.1"},"_npmOperationalInternal":{"tmp":"tmp/svelte-persisted-state_1.4.0_1769957925639_0.6907568227290528","host":"s3://npm-registry-packages-npm-production"}},"1.4.1":{"name":"svelte-persisted-state","version":"1.4.1","scripts":{"dev":"vite dev","build":"vite build && npm run package","preview":"vite preview","package":"svelte-kit sync && svelte-package && publint","prepublishOnly":"npm run package","check":"svelte-kit sync && svelte-check --tsconfig ./tsconfig.json","check:watch":"svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch","test":"vitest","lint":"prettier --check . && eslint .","format":"prettier --write ."},"exports":{".":{"types":"./dist/index.svelte.d.ts","svelte":"./dist/index.svelte.js"}},"peerDependencies":{"svelte":"^5.0.0-next.1"},"devDependencies":{"@sveltejs/adapter-auto":"^3.3.1","fake-indexeddb":"^6.0.0","@sveltejs/kit":"^2.37.0","@sveltejs/package":"^2.5.0","@sveltejs/vite-plugin-svelte":"^4.0.4","@types/eslint":"^9.6.1","eslint":"^9.34.0","eslint-config-prettier":"^9.1.2","eslint-plugin-svelte":"^2.46.1","globals":"^15.15.0","jsdom":"^25.0.1","prettier":"^3.6.2","prettier-plugin-svelte":"^3.4.0","publint":"^0.2.12","semantic-release":"^24.2.7","svelte":"^5.38.6","svelte-check":"^4.3.1","tslib":"^2.8.1","typescript":"^5.9.2","typescript-eslint":"^8.42.0","vite":"^5.4.19","vitest":"^2.1.9"},"svelte":"./dist/index.svelte.js","types":"./dist/index.svelte.d.ts","type":"module","license":"MIT","repository":{"type":"git","url":"git+https://github.com/oMaN-Rod/svelte-persisted-state.git"},"keywords":["svelte","localstorage","sessionstorage","persisted","state"],"_id":"svelte-persisted-state@1.4.1","gitHead":"5827494c3f6146d67bf6d898ae120cd03eb83220","description":"Svelte 5 persisted states, [svelte-persisted-store](https://github.com/joshnuss/svelte-persisted-store), but implemented with Svelte 5 Runes.","bugs":{"url":"https://github.com/oMaN-Rod/svelte-persisted-state/issues"},"homepage":"https://github.com/oMaN-Rod/svelte-persisted-state#readme","_nodeVersion":"24.15.0","_npmVersion":"10.9.3","dist":{"integrity":"sha512-Dhk4MmHxzHA0X70PONoq4TE+rmNg41mRbVKTFdW3f3vex1jv/sCKsgnBTHadbVBcx1clAMo2ERfYoHSv7omEyw==","shasum":"ffb76e37df6f79c73f7c8dc6ea661ed9ae9a4805","tarball":"https://registry.npmjs.org/svelte-persisted-state/-/svelte-persisted-state-1.4.1.tgz","fileCount":7,"unpackedSize":29841,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIAb908IbttUAvlqFaMAxk1FScv2oWffwkeUP+jIIDD7CAiB9h2dufcO+9r5Xom9fd+EzglZFywTEx7F3bNtymAf8CA=="}]},"_npmUser":{"name":"i_am_o","email":"omar@ojoa.dev"},"directories":{},"maintainers":[{"name":"i_am_o","email":"omar@ojoa.dev"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/svelte-persisted-state_1.4.1_1779150922922_0.15107995244370231"},"_hasShrinkwrap":false}},"time":{"created":"2024-09-28T18:35:30.971Z","modified":"2026-05-19T00:35:23.171Z","0.0.1":"2024-09-28T18:35:31.156Z","0.1.0":"2024-10-27T11:39:31.426Z","1.0.0":"2025-02-01T12:00:33.070Z","1.1.0":"2025-06-04T23:03:07.114Z","1.2.0":"2025-06-08T13:55:21.128Z","1.3.0":"2026-02-01T03:48:20.528Z","1.4.0":"2026-02-01T14:58:45.796Z","1.4.1":"2026-05-19T00:35:23.057Z"},"bugs":{"url":"https://github.com/oMaN-Rod/svelte-persisted-state/issues"},"license":"MIT","homepage":"https://github.com/oMaN-Rod/svelte-persisted-state#readme","keywords":["svelte","localstorage","sessionstorage","persisted","state"],"repository":{"type":"git","url":"git+https://github.com/oMaN-Rod/svelte-persisted-state.git"},"description":"Svelte 5 persisted states, [svelte-persisted-store](https://github.com/joshnuss/svelte-persisted-store), but implemented with Svelte 5 Runes.","maintainers":[{"name":"i_am_o","email":"omar@ojoa.dev"}],"readme":"# svelte-persisted-state\n\nSvelte 5 persisted states, [svelte-persisted-store](https://github.com/joshnuss/svelte-persisted-store), but implemented with Svelte 5 Runes.\n\n## Requirements\n\nThis package requires Svelte 5. It is not compatible with Svelte 4 or earlier versions.\n\n## Installation\n\n```bash\nnpm install svelte-persisted-state\n```\n\n## API\n\nThis package exports two functions:\n\n- `persistedState` - Synchronous storage (localStorage, sessionStorage, cookies)\n- `persistedStateAsync` - Asynchronous storage (IndexedDB) for large datasets\n\n### persistedState (Sync)\n\nThe `persistedState` function creates a persisted state that automatically syncs with local storage, session storage, or browser cookies.\n\n### Parameters\n\n- `key`: A string key used for storage.\n- `initialValue`: The initial value of the state.\n- `options`: An optional object with the following properties:\n  - `storage`: 'local' (default), 'session', or 'cookie'\n  - `serializer`: Custom serializer object with `parse` and `stringify` methods (default: JSON)\n  - `syncTabs`: Boolean to sync state across tabs (default: true, only works with localStorage)\n  - `cookieOptions`: Cookie-specific configuration object (only applies when storage is 'cookie'):\n    - `expireDays`: Number of days before cookie expires (default: 365, max: 400 due to browser limits)\n    - `maxAge`: Max-Age in seconds (takes precedence over expireDays if both are specified)\n    - `path`: Cookie path (default: '/')\n    - `domain`: Cookie domain (default: current domain)\n    - `secure`: Secure flag - cookie only sent over HTTPS (default: false)\n    - `sameSite`: SameSite attribute for CSRF protection - 'Strict' | 'Lax' | 'None' (default: 'Lax')\n    - `httpOnly`: HttpOnly flag - prevents client-side script access (default: false)\n  - `onWriteError`: Function to handle write errors\n  - `onParseError`: Function to handle parse errors\n  - `beforeRead`: Function to process value before reading\n  - `beforeWrite`: Function to process value before writing\n\n### Return Value\n\nThe `persistedState` function returns an object with the following properties:\n\n- `current`: Get or set the current state value.\n- `reset()`: Reset the state to its initial value.\n\n## Usage\n\n### Basic Usage\n\n```javascript\nimport { persistedState } from 'svelte-persisted-state';\n\nconst myState = persistedState('myKey', 'initialValue');\n\n// Use myState.current to get or set the state\nconsole.log(myState.current);\nmyState.current = 'newValue';\n\n// Reset to initial value\nmyState.reset();\n```\n\n### Typed Usage\n\n```typescript\nimport { persistedState } from 'svelte-persisted-state';\n\ninterface UserPreferences {\n\ttheme: 'light' | 'dark';\n\tfontSize: number;\n\tnotifications: boolean;\n}\n\nconst userPreferences = persistedState<UserPreferences>(\n\t'userPreferences',\n\t{\n\t\ttheme: 'light',\n\t\tfontSize: 16,\n\t\tnotifications: true\n\t},\n\t{\n\t\tstorage: 'local',\n\t\tsyncTabs: true,\n\t\tbeforeWrite: (value) => {\n\t\t\tconsole.log('Saving preferences:', value);\n\t\t\treturn value;\n\t\t},\n\t\tonWriteError: (error) => {\n\t\t\tconsole.error('Failed to save preferences:', error);\n\t\t}\n\t}\n);\n\nfunction toggleTheme() {\n\tuserPreferences.current.theme = userPreferences.current.theme === 'light' ? 'dark' : 'light';\n}\n\n// Using $derived for reactive computations\nconst theme = $derived(userPreferences.current.theme);\n\n// The UI will automatically update when the state changes\n```\n\n### Custom serialization for complex objects (Maps, Sets, Dates)\n\nJSON can't natively serialize objects like Map, Set, Date, BigInt, or circular references. To persist such values, pass a custom serializer. A simple and reliable option is [devalue](https://github.com/sveltejs/devalue).\n\nInstall devalue:\n\n```bash\nnpm install devalue\n```\n\nUse it as the serializer:\n\n```typescript\nimport { persistedState } from 'svelte-persisted-state';\nimport * as devalue from 'devalue';\n\nconst devalueSerializer = {\n\tstringify: devalue.stringify,\n\tparse: devalue.parse\n};\n\n// Works with Maps, Sets, Dates, nested structures, etc.\nexport const complexData = persistedState(\n\t'complexData',\n\t{\n\t\tname: 'Example',\n\t\tcreated: new Date(),\n\t\tnested: {\n\t\t\tarray: [1, 2, 3],\n\t\t\tmap: new Map([\n\t\t\t\t['key1', 'value1'],\n\t\t\t\t['key2', 'value2']\n\t\t\t]),\n\t\t\tset: new Set([1, 2, 3])\n\t\t}\n\t},\n\t{\n\t\tserializer: devalueSerializer\n\t}\n);\n\n// Tip: if you mutate a Map/Set in-place, reassign to trigger reactivity:\n// complexData.current.nested.map.set('key3', 'value3');\n// complexData.current = { ...complexData.current };\n```\n\n### Cookie Storage\n\nYou can use cookies for storage, which is useful for SSR scenarios or when you need data to persist across subdomains:\n\n```typescript\nimport { persistedState } from 'svelte-persisted-state';\n\nconst cookieState = persistedState('myCookieKey', 'defaultValue', {\n\tstorage: 'cookie',\n\tcookieOptions: {\n\t\texpireDays: 30 // Custom expiration\n\t}\n});\n```\n\nNotes:\n\n- Cookies have a size limit (~4KB per cookie)\n- `syncTabs` doesn’t work with cookies\n- Cookies are sent with every HTTP request\n- Modern browsers cap expiration at about 400 days\n\n### persistedStateAsync (Async)\n\nFor large datasets (50MB+) or async usage, use `persistedStateAsync` with IndexedDB:\n\n```typescript\nimport { persistedStateAsync } from 'svelte-persisted-state';\n\nconst largeData = persistedStateAsync('large-dataset', [], {\n\tindexedDB: {\n\t\tdbName: 'my-app', // default: 'svelte-persisted-state'\n\t\tstoreName: 'state', // default: 'state'\n\t\tversion: 1 // default: 1\n\t},\n\tsyncTabs: true, // Uses BroadcastChannel for cross-tab sync\n\tonHydrated: (value) => console.log('Data loaded:', value.length)\n});\n```\n\n#### Native Type Support (Structured Clone)\n\nUnlike `persistedState` which uses JSON serialization by default, `persistedStateAsync` uses IndexedDB's native [Structured Clone Algorithm](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm). This means you can store complex JavaScript types directly without a custom serializer:\n\n```typescript\n// Date, Map, Set, RegExp, TypedArrays work out of the box!\nconst appState = persistedStateAsync('app-state', {\n\tlastVisit: new Date(),\n\tuserTags: new Set(['svelte', 'typescript']),\n\tpreferences: new Map([\n\t\t['theme', 'dark'],\n\t\t['language', 'en']\n\t]),\n\tpattern: /search-\\d+/gi,\n\tbuffer: new Uint8Array([1, 2, 3, 4])\n});\n\n// No serializer needed - values are stored natively\nawait appState.ready;\nconsole.log(appState.current.lastVisit instanceof Date); // true\nconsole.log(appState.current.userTags instanceof Set); // true\n```\n\n**Benefits over JSON:**\n\n- Native support for `Date`, `Map`, `Set`, `RegExp`, `ArrayBuffer`, `TypedArray`, `Blob`, `File`\n- Handles circular references\n- No serialization/deserialization overhead\n- Better performance for large objects\n\nIf you need JSON or custom serialization, you can opt-in:\n\n```typescript\nconst legacyData = persistedStateAsync('legacy-key', {}, {\n\tserializer: JSON // Opt-in to JSON (or custom) serialization\n});\n```\n\n#### Parameters\n\n- `key`: A string key used for storage\n- `initialValue`: The initial value (returned immediately, before hydration)\n- `options`: An optional object with the following properties:\n  - `indexedDB`: IndexedDB configuration object:\n    - `dbName`: Database name (default: 'svelte-persisted-state')\n    - `storeName`: Object store name (default: 'state')\n    - `version`: Database version (default: 1)\n  - `serializer`: Custom serializer with `parse` and `stringify` methods (default: none, uses structured clone)\n  - `syncTabs`: Boolean to sync state across tabs via BroadcastChannel (default: true)\n  - `onWriteError`: Function to handle write errors\n  - `onParseError`: Function to handle parse errors (only applies when using a serializer)\n  - `onHydrated`: Callback when hydration completes with the loaded value\n  - `onHydrationError`: Function to handle hydration errors\n  - `beforeRead`: Function to process value before reading\n  - `beforeWrite`: Function to process value before writing\n\n#### Return Value\n\n`persistedStateAsync` returns immediately with the initial value and hydrates asynchronously in the background:\n\n```typescript\ninterface AsyncPersistedState<T> {\n\tcurrent: T; // Get or set the current value (reactive)\n\tisLoading: boolean; // True while hydrating from IndexedDB\n\tready: Promise<T>; // Resolves when hydration completes\n\treset(): void; // Reset to initial value\n}\n```\n\n#### Automatic Reactivity (Simplest Usage)\n\nSince `current` is reactive (`$state`), the UI automatically updates when hydration completes. **No loading state handling is required** if you're okay with the initial value showing briefly:\n\n```svelte\n<script lang=\"ts\">\n\timport { persistedStateAsync } from 'svelte-persisted-state';\n\n\tconst notes = persistedStateAsync('notes', []);\n</script>\n\n<!-- This automatically updates when data loads from IndexedDB -->\n<p>You have {notes.current.length} notes</p>\n\n{#each notes.current as note}\n\t<div>{note.title}</div>\n{/each}\n\n<button onclick={() => notes.current = [...notes.current, { title: 'New' }]}>\n\tAdd Note\n</button>\n```\n\n#### Optional: Loading States\n\nIf you want to show a loading indicator while hydrating, use `isLoading` or `{#await}`:\n\n```svelte\n<!-- Using isLoading -->\n{#if data.isLoading}\n\t<Spinner />\n{:else}\n\t<List items={data.current} />\n{/if}\n\n<!-- Using {#await} -->\n{#await data.ready}\n\t<p>Loading...</p>\n{:then}\n\t<List items={data.current} />\n{:catch error}\n\t<p>Error: {error.message}</p>\n{/await}\n```\n\n#### Awaiting in JavaScript\n\n```typescript\nconst data = persistedStateAsync('my-data', []);\n\n// Optionally wait for hydration\nawait data.ready;\nconsole.log('Hydrated:', data.current);\n\n// Or capture the hydrated value directly\nconst value = await data.ready;\nconsole.log('Hydrated:', value);\n```\n\n### Type Exports\n\nFor TypeScript users, the following types are exported:\n\n```typescript\nimport type {\n\tAsyncOptions,\n\tAsyncPersistedState,\n\tIndexedDBOptions\n} from 'svelte-persisted-state';\n```\n\n### Storage Comparison\n\n| Feature            | localStorage                | sessionStorage          | cookies                  | IndexedDB                  |\n| ------------------ | --------------------------- | ----------------------- | ------------------------ | -------------------------- |\n| **Persistence**    | Until manually cleared      | Until tab/window closes | Until expiration date    | Until manually cleared     |\n| **Size Limit**     | ~5-10MB                     | ~5-10MB                 | ~4KB                     | ~50MB+ (browser dependent) |\n| **API Type**       | Sync                        | Sync                    | Sync                     | Async                      |\n| **Server Access**  | No                          | No                      | Yes (sent with requests) | No                         |\n| **Tab Sync**       | Yes (with `syncTabs: true`) | No                      | No                       | Yes (via BroadcastChannel) |\n| **SSR Compatible** | No                          | No                      | Yes                      | No                         |\n| **Expiration**     | Manual                      | Automatic               | Configurable             | Manual                     |\n\n## Examples\n\n### Complete Example\n\n```svelte\n<script lang=\"ts\">\n\timport { persistedState } from 'svelte-persisted-state';\n\n\tinterface UserPreferences {\n\t\ttheme: 'light' | 'dark';\n\t\tfontSize: number;\n\t}\n\n\tconst preferences = persistedState<UserPreferences>('preferences', {\n\t\ttheme: 'light',\n\t\tfontSize: 16\n\t});\n\n\tconst theme = $derived(preferences.current.theme);\n\tconst fontSize = $derived(preferences.current.fontSize);\n</script>\n\n<div style=\"font-size: {fontSize}px\">\n\t<button onclick={() => (preferences.current.theme = theme === 'light' ? 'dark' : 'light')}>\n\t\tSwitch to {theme === 'light' ? 'dark' : 'light'} theme\n\t</button>\n\t<button onclick={() => (preferences.current.fontSize -= 1)}> Decrease font size </button>\n\t<button onclick={() => (preferences.current.fontSize += 1)}> Increase font size </button>\n\t<p>Current theme: {theme}</p>\n\t<p>Current font size: {fontSize}px</p>\n</div>\n```\n\n### Cookie Storage Example\n\n```svelte\n<script lang=\"ts\">\n\timport { persistedState } from 'svelte-persisted-state';\n\t// User session data stored in cookies (expires in 30 days)\n\tconst userSession = persistedState(\n\t\t'user-session',\n\t\t{\n\t\t\tisLoggedIn: false,\n\t\t\tusername: ''\n\t\t},\n\t\t{\n\t\t\tstorage: 'cookie',\n\t\t\tcookieOptions: {\n\t\t\t\texpireDays: 30\n\t\t\t}\n\t\t}\n\t);\n\n\t// Shopping cart stored in cookies (expires in 7 days)\n\tconst cart = persistedState('shopping-cart', [], {\n\t\tstorage: 'cookie',\n\t\tcookieOptions: {\n\t\t\texpireDays: 7\n\t\t}\n\t});\n\n\tfunction login(username: string) {\n\t\tuserSession.current = { isLoggedIn: true, username };\n\t}\n\n\tfunction logout() {\n\t\tuserSession.current = { isLoggedIn: false, username: '' };\n\t}\n</script>\n\n{#if userSession.current.isLoggedIn}\n\t<p>Welcome back, {userSession.current.username}!</p>\n\t<button onclick={logout}>Logout</button>\n{:else}\n\t<button onclick={() => login('demo-user')}>Login as Demo User</button>\n{/if}\n\n<p>Cart items: {cart.current.length}</p>\n```\n\n## License\n\nMIT\n","readmeFilename":"README.md"}