{"_id":"@piotr-cz/swr-idb-cache","_rev":"9-c853945ceb56cf58a98a8fbb4ead706c","name":"@piotr-cz/swr-idb-cache","dist-tags":{"latest":"1.1.2"},"versions":{"1.0.0-rc.1":{"name":"@piotr-cz/swr-idb-cache","version":"1.0.0-rc.1","keywords":["swr","cache","IndexedDB","idb"],"author":{"url":"https://www.piotr.cz","name":"Piotr Konieczny","email":"hello@piotr.cz"},"license":"MIT","_id":"@piotr-cz/swr-idb-cache@1.0.0-rc.1","maintainers":[{"name":"piotr-cz","email":"hello@piotr.cz"}],"homepage":"https://github.com/piotr-cz/swr-idb-cache","bugs":{"url":"https://github.com/piotr-cz/swr-idb-cache/issues"},"dist":{"shasum":"38fce299b34e8f66a6194c6fdb003a2b68b58116","tarball":"https://registry.npmjs.org/@piotr-cz/swr-idb-cache/-/swr-idb-cache-1.0.0-rc.1.tgz","fileCount":7,"integrity":"sha512-Y43xfGeqgNzk9hs0GvpyEFf0hub+UI8D1UDM5JbrrbxHOAmzjqJPlhCL1WarTKKpEHkH69ZeqdgfF5aK/clcvA==","signatures":[{"sig":"MEUCIQCPBscDRrcRsVGz/SwCNqMqKZ3qRCgXC5hTqH9os77HQwIgerxUiegJV0QRChVkp+qxvGhkEpuFaDKZ0jPEMrwRCv8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":46557,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjRs/OACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpIExAAn+ln1xHFYpoF9ixulmjPPBdXwZ6e1Av+vAsVmf/t0AGvHIht\r\nQ3b6lljPZI9P75edwmyHUHbTgYBxAYnALPnSuKy94jlZcVGGkupqqI7ab6GS\r\nXT2tt6vCHQHrKoys9EM51EkUiYhxJ+5ZANaXH2MIfMrhJy5LEdb8m58q/fwX\r\nd8d6u4mQ4DMjRXMIGv4Bm7uxh9xTYbkr+54UlfnY3t71oxv7XD8zfbqQbFbm\r\nat8zogbJ24qHy6PKQk722sX7z/pO6KA5wZK9ijyPsSo3+nj5P3NjmELQg8Sh\r\nLvk7l3/1d+rx2qTuptaJdL0Ypxtz9zmUPd4bSjyeBg/ZOf+foxtacwhMYaJI\r\nyBVIHToC/pEKWT62oa5D0QyWr++aQw//41Z4ToUKQM2gcYJjAK2oyDwCxMfy\r\nTE5AiKRPmgSpWbVyAEbOiaBZzAaRo+UJpwLH8zjqrPfDSStCjjRz86IWqjp0\r\nlHzX8WAt+2LzCD6ca+WR4Ap2C3vnj+oqP1K21mQFHdBfmcz+f1p0EZzzRwlx\r\ndJ+h0JVyMUSzNLP+jcjFoYPdY4dpGe1QLdfI9B0w5G598OryVAlxhmvOUOmZ\r\nehKbO89f+VyBz4p5RmLuiD7+1j+xitZkVTyzTcUQIXeuKz5TsuhPCr/RRsP5\r\nUjDhTVWVwScLlonGgkeIWBXcSsWhZFpee8k=\r\n=phxC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.cjs.js","types":"dist/index.d.ts","module":"dist/index.esm.js","exports":{"import":"./dist/index.mjs","module":"./dist/index.esm.js","require":"./dist/index.cjs.js"},"gitHead":"51406a211cd70d20dae20ae50c75aac0e138885c","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"bunchee src/index.ts","prepare":"npm run build","npmpublish":"npm publish --access public","types:check":"tsc --noEmit"},"_npmUser":{"name":"piotr-cz","email":"hello@piotr.cz"},"repository":{"url":"git+https://github.com/piotr-cz/swr-idb-cache.git","type":"git"},"_npmVersion":"8.15.0","description":"IndexedDB Cache Provider for SWR","directories":{},"_nodeVersion":"16.17.1","dependencies":{"idb":"^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0"},"_hasShrinkwrap":false,"devDependencies":{"swr":"^1.3.0","react":"^17.0.0","bunchee":"^2.1.5","typescript":"^4.6.3","@types/react":"^17.0.43"},"peerDependencies":{"swr":"^1.0.0","react":"^16.11.0 || ^17.0.0"},"_npmOperationalInternal":{"tmp":"tmp/swr-idb-cache_1.0.0-rc.1_1665585102534_0.9474022496490722","host":"s3://npm-registry-packages"}},"1.0.0-rc.2":{"name":"@piotr-cz/swr-idb-cache","version":"1.0.0-rc.2","keywords":["swr","cache","IndexedDB","idb"],"author":{"url":"https://www.piotr.cz","name":"Piotr Konieczny","email":"hello@piotr.cz"},"license":"MIT","_id":"@piotr-cz/swr-idb-cache@1.0.0-rc.2","maintainers":[{"name":"piotr-cz","email":"hello@piotr.cz"}],"homepage":"https://github.com/piotr-cz/swr-idb-cache","bugs":{"url":"https://github.com/piotr-cz/swr-idb-cache/issues"},"dist":{"shasum":"f4ca9fd2eb92fce04ddfdf92c127b06d63045eaf","tarball":"https://registry.npmjs.org/@piotr-cz/swr-idb-cache/-/swr-idb-cache-1.0.0-rc.2.tgz","fileCount":7,"integrity":"sha512-XYVf2D+zsZnhh9JPfMouZwkGCsHfNS+ONtGZ176Ottr2m+A47CakNBsEdRz1aHQ8Wz8pCjL8J3cJWhy78BBJbw==","signatures":[{"sig":"MEQCIFx1U9rL93sIBvlNWC64sIeDCtQWqjXT5dXGX3sFWTBMAiAKDP+AX2j4AC6rL5imQvnWI93QPh1jQObD9QrpzUMR+g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":43397,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjT6QqACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq9Vw//RnBLmzhyJOr66Qf06cLQznoVp237tWfrv1vDG1kojUjOi9hT\r\nRxB0mPRUhKT4/4jFs/ezjclmdF4uYtBgS5kvGQWbUVZFnS3NPO+X3tYx9nYq\r\nox8u5S1QsO4ZqfYrP6umfls7y4tMzuuhhkn+l9n6I/7Isa0Ue/TYv401XMUI\r\niepXaMoWAYTsjk55eZRPwG6DLG0aR/qmq82UthFBteB/MT8Ta+KuWqBT9glI\r\nByjg+VhO57H/Lj8K9d9lTuC4fpT0uag3bQOv+QfNMffGo1YiCNHYPOIBhZNR\r\n8tazjYMjMGVeb4kyj0HWj+tI50jS1mkf82TVjNnmcN6trreTvLb2lvF5zPnz\r\nODqBMZmXvzdoaeuUWlTM4WLnLHHNU9Hg2cVB+LVl4QYl+OMBzt4xVyU4njkP\r\nCAzMi8HTOgRki8mt/9l96IX8q4RcZEaFNbQtbpp936DRSBTBpibcbIBHbKse\r\n0guSOvRwG6jqKHGA2uYfWIhCKW84AC5UhPpYCNbcX6thMej7XRrGTKS3mz7o\r\nfz6GFiLBAL2N1lMFkmxgRxLNkGCnDktNZ4cpF/ztCBf3N9TwqyNRnPObN8Ox\r\n2QxekIUuIBsD1OA+zvX7xAd2Xp37KCpOXLArmLjcn+UfB+fo21giCuMlUlMs\r\n6Zovb4efgohWtIFg8EUhQTz8xkDWp9aXmts=\r\n=zOKp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.cjs.js","types":"dist/index.d.ts","module":"dist/index.esm.js","exports":{"import":"./dist/index.mjs","module":"./dist/index.esm.js","require":"./dist/index.cjs.js"},"gitHead":"122f62f77ce867c1df1b8430da5788528033ca8b","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"bunchee src/index.ts","prepare":"npm run build","npmpublish":"npm publish --access public","types:check":"tsc --noEmit"},"_npmUser":{"name":"piotr-cz","email":"hello@piotr.cz"},"repository":{"url":"git+https://github.com/piotr-cz/swr-idb-cache.git","type":"git"},"_npmVersion":"8.19.2","description":"IndexedDB Cache Provider for SWR","directories":{},"_nodeVersion":"16.18.0","dependencies":{"idb":"^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0"},"_hasShrinkwrap":false,"devDependencies":{"swr":"^1.3.0","react":"^17.0.0","bunchee":"^2.1.5","typescript":"^4.6.3","@types/react":"^17.0.43"},"peerDependencies":{"swr":"^1.0.0","react":"^16.11.0 || ^17.0.0"},"_npmOperationalInternal":{"tmp":"tmp/swr-idb-cache_1.0.0-rc.2_1666163754047_0.9571533980861531","host":"s3://npm-registry-packages"}},"1.0.0-rc.3":{"name":"@piotr-cz/swr-idb-cache","version":"1.0.0-rc.3","keywords":["swr","cache","IndexedDB","idb"],"author":{"url":"https://www.piotr.cz","name":"Piotr Konieczny","email":"hello@piotr.cz"},"license":"MIT","_id":"@piotr-cz/swr-idb-cache@1.0.0-rc.3","maintainers":[{"name":"piotr-cz","email":"hello@piotr.cz"}],"homepage":"https://github.com/piotr-cz/swr-idb-cache","bugs":{"url":"https://github.com/piotr-cz/swr-idb-cache/issues"},"dist":{"shasum":"fec9004b7ebeb88b9c17c2b168ba55e4a7aeac58","tarball":"https://registry.npmjs.org/@piotr-cz/swr-idb-cache/-/swr-idb-cache-1.0.0-rc.3.tgz","fileCount":7,"integrity":"sha512-LvF7DKsmYKbqLWSPdLgR5ALyqo8/64tGKyPanbfpowwjs7j2VjWEEpJ66wsQBsmpk1YULgAGnP7le9sVw1+L+w==","signatures":[{"sig":"MEUCIQDfwdGapL/ZQIzcVTvhRCNUZtH1km7h8OROPBwuV7kF5AIgRE9VlD2w7nZzijEE/pAuFmu6SIF5VaCXmJy5znicHtg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":44597,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjfi01ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpEOg/+KMAoNl0GdSH0ODtBvyrjqse/g8N0ltOFI34REBDNIQJ3YVA3\r\nrbLjoNYDLrRf8G0Xn/Leo7CPAZ6gKNpwT0JWCISt+zrEysChSKm1bIDS1IzK\r\ntAsCO26frEZeJv3BhpDU6KtrVTR28+XcW8MPThR4WAUYs6JNL18n++n6PYsY\r\nT2uuHZJARmxaMhuZ+JxwXoAAfInJPASL4is+1tvf2XvGsWfEOupjRegJQqWm\r\nTNxm8EH2/NcCi54OfSsMD4kh23YHS43Ermh+KQG3s0J3SbXEH6pp7FXMsvgz\r\n2KvlB7DwwqRd7Q5ved3qnKFnUNDfVJh893Jy5Vj6ZuA/5P/o3da/32jzdp5+\r\nreDI3VuwQ52LEUWBBnzF80mek/LXm3c9zJ0X76TPAeUTaA9gvLXzIK9biWrs\r\nnOVLBkTRE9hbBye0TnCo7OVheLtEL17wZqo5rZ8pG6FXXcsn0EHvLHQRFMPa\r\nLPhJ9IS4+2WvUemMv1icxjf9WghMdQ2zRqsGJWbbx+x+003WyFWyI2m36aiS\r\nYajPZaCnb7FSB8sU6e6IyS2GNikGFXMHYVywE/GF5uyGqdS4RjAa0bRvJcD+\r\nGUwSZEkbdcUfydz+/hB1MIZ3dSi3dSrQIlDXOTduWSW8kmFMczYd1W5rvCwv\r\nlqx72LL2AIGBBuz0fxDJsSLU7DjRb+aYKV4=\r\n=3poP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.cjs.js","types":"dist/index.d.ts","module":"dist/index.esm.js","exports":{"import":"./dist/index.mjs","module":"./dist/index.esm.js","require":"./dist/index.cjs.js"},"gitHead":"6feb06315350c6d7c0411eeb9d6a4a5db8acca51","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"bunchee src/index.ts","prepare":"npm run build","npmpublish":"npm publish --access public","types:check":"tsc --noEmit"},"_npmUser":{"name":"piotr-cz","email":"hello@piotr.cz"},"repository":{"url":"git+https://github.com/piotr-cz/swr-idb-cache.git","type":"git"},"_npmVersion":"8.19.2","description":"IndexedDB Cache Provider for SWR","directories":{},"_nodeVersion":"16.18.0","dependencies":{"idb":"^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"swr":"^2.0.0-rc.0","react":"^17.0.0","bunchee":"^2.1.5","typescript":"^4.6.3","@types/react":"^17.0.43"},"peerDependencies":{"swr":"^2.0.0-beta.3","react":"^16.11.0 || ^17.0.0 || ^18.0.0"},"_npmOperationalInternal":{"tmp":"tmp/swr-idb-cache_1.0.0-rc.3_1669213493518_0.802829833338955","host":"s3://npm-registry-packages"}},"1.0.0":{"name":"@piotr-cz/swr-idb-cache","version":"1.0.0","keywords":["swr","cache","IndexedDB","idb"],"author":{"url":"https://www.piotr.cz","name":"Piotr Konieczny","email":"hello@piotr.cz"},"license":"MIT","_id":"@piotr-cz/swr-idb-cache@1.0.0","maintainers":[{"name":"piotr-cz","email":"hello@piotr.cz"}],"homepage":"https://github.com/piotr-cz/swr-idb-cache","bugs":{"url":"https://github.com/piotr-cz/swr-idb-cache/issues"},"dist":{"shasum":"c2fb54fb40d9f1e2e0e41ab0f4262ff3cd5c221e","tarball":"https://registry.npmjs.org/@piotr-cz/swr-idb-cache/-/swr-idb-cache-1.0.0.tgz","fileCount":7,"integrity":"sha512-Rquq86LXzienk3nIzAazDw24dLv3BJzvXYTJyq5aoOW7xaTQFjL3tdLDiASGI9wbk7alYNrIX8ld6Y6avOJYfw==","signatures":[{"sig":"MEUCIGxpLuxtemuYPqhMNAP2ryl86f6tJ8GNMAIAhedEbIrtAiEArYwgjhtp5j2iLDmvP1Q1f7fwZJpbvJoO7zkgPRKglFw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":45199,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjrrb6ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqhHg//XyK6ekn9BrqfO643ufokHDjyNbiOkyMLTia5nztt8Y1ACSL6\r\nBt8vnD0pnoSbrFe9mpUQKaZ8fJub2weaSzDx1ITna1AXzdGj7ERtU3inylQ4\r\ngKxLYf43LjHGxrYWP0Q2EIFHN9pYacKFR2/OGY0ET4/0Z/PTpLVnL/iB0rI9\r\n9e/i6VB7gamLiwtubTwBYlsY3/+bYzk6yBTSiAU3KHJHyEUEVWkXvg4T4BpR\r\nIqEScIlYrHtNFVOUwcKGYTPwL1uNfP3uW3//+pYyUayuZSD47/0lHWJXYorb\r\nn8OhAP24XBLUZUnhJ3ho7I2mX+FxMPvLH70bBdJE1xTIi49NEHynuwY0fqUo\r\njobAMiUXDWF3fBK4r6dD6qnMX9pY0lsIXjfSlGFumVuhIxWU/P+coSLL/XMG\r\nnhPRQFnLpP2PsURPWyvE8CaERErypmFkq30Xgz2tzMq6WOxsJUjaDpsEIC3/\r\n1GnsgV4+32gBRVhWmxwVLIkS67LWUt4paXm5FoEjvJGSfP45dh2pU7gxu/vx\r\nYK4DByUm30LhTPntB7xkA4JUgLeUmq3UNykhxXV3nKnyHi1tjOxi17RhTEzP\r\n9jKjqgcligQwUsuttJJr8fnacn3wUbRzlT4/BmSc5YpPFXrqydVYjHyDLCuQ\r\nOzc9+2MRcOAYr8HmxrGASPsixNEBhhs150s=\r\n=23Hz\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.cjs.js","types":"dist/index.d.ts","module":"dist/index.esm.js","exports":{"import":"./dist/index.mjs","module":"./dist/index.esm.js","require":"./dist/index.cjs.js"},"gitHead":"f7fe5bc5ae54b54c64d17991a41865a8ae037cf4","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"bunchee src/index.ts","prepare":"npm run build","npmpublish":"npm publish --access public","types:check":"tsc --noEmit"},"_npmUser":{"name":"piotr-cz","email":"hello@piotr.cz"},"repository":{"url":"git+https://github.com/piotr-cz/swr-idb-cache.git","type":"git"},"_npmVersion":"8.19.2","description":"IndexedDB Cache Provider for SWR","directories":{},"_nodeVersion":"16.18.0","dependencies":{"idb":"^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"swr":"^2.0.0","react":"^17.0.0","bunchee":"^2.2.0","typescript":"^4.6.3","@types/react":"^17.0.43"},"peerDependencies":{"swr":"^2.0.0-beta.3","react":"^16.11.0 || ^17.0.0 || ^18.0.0"},"_npmOperationalInternal":{"tmp":"tmp/swr-idb-cache_1.0.0_1672394489829_0.047874867698090684","host":"s3://npm-registry-packages"}},"1.0.1":{"name":"@piotr-cz/swr-idb-cache","version":"1.0.1","keywords":["swr","cache","IndexedDB","idb"],"author":{"url":"https://www.piotr.cz","name":"Piotr Konieczny","email":"hello@piotr.cz"},"license":"MIT","_id":"@piotr-cz/swr-idb-cache@1.0.1","maintainers":[{"name":"piotr-cz","email":"hello@piotr.cz"}],"homepage":"https://github.com/piotr-cz/swr-idb-cache","bugs":{"url":"https://github.com/piotr-cz/swr-idb-cache/issues"},"dist":{"shasum":"ab67ee8057a7327871bd675ef38f6ecb6599caa5","tarball":"https://registry.npmjs.org/@piotr-cz/swr-idb-cache/-/swr-idb-cache-1.0.1.tgz","fileCount":7,"integrity":"sha512-SfytA+xts4QCwgA12jOYO5p0tlNsCzIdlTwObv7MouH8Jhufs0pnWMcT7VQXVkKsuyoTuA1JfeZQ1D+fjj7Tdw==","signatures":[{"sig":"MEYCIQD8EmL9a/Rnw3QwJrr2k7mHYxiN6RyZNDFmW8dL1fIJoAIhANmzkkjdt8PVfHSSCDe2p5oyXm7pH8Gs1PtVWErw6y5d","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":45995},"main":"dist/index.cjs.js","types":"dist/index.d.ts","module":"dist/index.esm.js","exports":{"import":"./dist/index.mjs","module":"./dist/index.esm.js","require":"./dist/index.cjs.js"},"gitHead":"962db4708adaa3c56dfb5f07f84ed63b2cb15dba","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"bunchee src/index.ts","prepare":"npm run build","npmpublish":"npm publish --access public","types:check":"tsc --noEmit"},"_npmUser":{"name":"piotr-cz","email":"hello@piotr.cz"},"repository":{"url":"git+https://github.com/piotr-cz/swr-idb-cache.git","type":"git"},"_npmVersion":"8.19.2","description":"IndexedDB Cache Provider for SWR","directories":{},"_nodeVersion":"16.18.0","dependencies":{"idb":"^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"swr":"^2.0.0","react":"^17.0.0","bunchee":"^3.2.0","typescript":"^5.1.3","@types/react":"^17.0.60"},"peerDependencies":{"swr":"^2.0.0-beta.3","react":"^16.11.0 || ^17.0.0 || ^18.0.0"},"_npmOperationalInternal":{"tmp":"tmp/swr-idb-cache_1.0.1_1686058263222_0.06571778022315233","host":"s3://npm-registry-packages"}},"1.0.2":{"name":"@piotr-cz/swr-idb-cache","version":"1.0.2","keywords":["swr","cache","IndexedDB","idb"],"author":{"url":"https://www.piotr.cz","name":"Piotr Konieczny","email":"hello@piotr.cz"},"license":"MIT","_id":"@piotr-cz/swr-idb-cache@1.0.2","maintainers":[{"name":"piotr-cz","email":"hello@piotr.cz"}],"homepage":"https://github.com/piotr-cz/swr-idb-cache","bugs":{"url":"https://github.com/piotr-cz/swr-idb-cache/issues"},"dist":{"shasum":"a35d61574016f1e02a7ab9a32e46e5fcbacee084","tarball":"https://registry.npmjs.org/@piotr-cz/swr-idb-cache/-/swr-idb-cache-1.0.2.tgz","fileCount":7,"integrity":"sha512-OwSwq3wV4VgLXEtIObK6fR3265nBMeLZKPxXlxaVbhtNEFp4KbWNwcJbyt5om9CSZvw7aDNDL9hZnW91i0PRTQ==","signatures":[{"sig":"MEUCIQDU/S00macC43QwqbINdpUXBaiDOMpkadnuLENvAEV7BAIgUplIwR8NlyUXLILPCsJjJr7MaJhDueZPqXJxP/Rgwwo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":45988},"main":"./dist/index.cjs.js","types":"./dist/index.d.ts","module":"./dist/index.esm.js","exports":{"import":"./dist/index.mjs","module":"./dist/index.esm.js","require":"./dist/index.cjs.js"},"gitHead":"4e3e7f7780b19a14437456b80e85162cabcc1b3b","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"bunchee src/index.ts","prepare":"npm run build","npmpublish":"npm publish --access public","types:check":"tsc --noEmit"},"_npmUser":{"name":"piotr-cz","email":"hello@piotr.cz"},"repository":{"url":"git+https://github.com/piotr-cz/swr-idb-cache.git","type":"git"},"_npmVersion":"9.8.1","description":"IndexedDB Cache Provider for SWR","directories":{},"_nodeVersion":"18.18.2","dependencies":{"idb":"^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"swr":"^2.0.0","react":"^17.0.0","bunchee":"3.2.1","typescript":"^5.3.3","@types/react":"^18.2.59"},"peerDependencies":{"swr":"^2.0.0-beta.3","react":"^16.11.0 || ^17.0.0 || ^18.0.0"},"_npmOperationalInternal":{"tmp":"tmp/swr-idb-cache_1.0.2_1710009382193_0.6198146205844361","host":"s3://npm-registry-packages"}},"1.0.3":{"name":"@piotr-cz/swr-idb-cache","version":"1.0.3","keywords":["swr","cache","IndexedDB","idb"],"author":{"url":"https://www.piotr.cz","name":"Piotr Konieczny","email":"hello@piotr.cz"},"license":"MIT","_id":"@piotr-cz/swr-idb-cache@1.0.3","maintainers":[{"name":"piotr-cz","email":"hello@piotr.cz"}],"homepage":"https://github.com/piotr-cz/swr-idb-cache","bugs":{"url":"https://github.com/piotr-cz/swr-idb-cache/issues"},"dist":{"shasum":"b40517e41bfc36454a07ea40f334050c22f8e7f4","tarball":"https://registry.npmjs.org/@piotr-cz/swr-idb-cache/-/swr-idb-cache-1.0.3.tgz","fileCount":7,"integrity":"sha512-176v8LvxeBctd4BB23Ybol49thwNnxxHXNWgqwscmoykTCoHayjiP+oeXU1pPYYrrFf7v1owNG2Et3SD68RWuQ==","signatures":[{"sig":"MEUCID7CfcIDBmY1rpIXF0Lo+IJTpYijHewK7mRW+1RYoD2nAiEAt6JXvTmxmh14tt1U86OtJ0jCuWnH9WMSqmYzfzouDqo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":46022},"main":"./dist/index.cjs.js","types":"./dist/index.d.ts","module":"./dist/index.esm.js","exports":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","module":"./dist/index.esm.js","require":"./dist/index.cjs.js"},"gitHead":"49cdd7998a4984fd44600f754eb163a45879d424","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"bunchee src/index.ts","prepare":"npm run build","npmpublish":"npm publish --access public","types:check":"tsc --noEmit"},"_npmUser":{"name":"piotr-cz","email":"hello@piotr.cz"},"repository":{"url":"git+https://github.com/piotr-cz/swr-idb-cache.git","type":"git"},"_npmVersion":"9.8.1","description":"IndexedDB Cache Provider for SWR","directories":{},"_nodeVersion":"18.18.2","dependencies":{"idb":"^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"swr":"^2.0.0","react":"^17.0.0","bunchee":"3.2.1","typescript":"^5.3.3","@types/react":"^18.2.59"},"peerDependencies":{"swr":"^2.0.0-beta.3","react":"^16.11.0 || ^17.0.0 || ^18.0.0"},"_npmOperationalInternal":{"tmp":"tmp/swr-idb-cache_1.0.3_1713771587700_0.11826808310521031","host":"s3://npm-registry-packages"}},"1.1.0":{"name":"@piotr-cz/swr-idb-cache","version":"1.1.0","keywords":["swr","cache","IndexedDB","idb"],"author":{"url":"https://www.piotr.cz","name":"Piotr Konieczny","email":"hello@piotr.cz"},"license":"MIT","_id":"@piotr-cz/swr-idb-cache@1.1.0","maintainers":[{"name":"piotr-cz","email":"hello@piotr.cz"}],"homepage":"https://github.com/piotr-cz/swr-idb-cache","bugs":{"url":"https://github.com/piotr-cz/swr-idb-cache/issues"},"dist":{"shasum":"7e275e4e50c8f75f9d976ee75331d1876f54cd34","tarball":"https://registry.npmjs.org/@piotr-cz/swr-idb-cache/-/swr-idb-cache-1.1.0.tgz","fileCount":7,"integrity":"sha512-CquQl3CICiPP9ayF0qfPdSOId3/zdwwFB2uk/jrgCWYwAGHmOUvGJeF4czmN4hLV/0YucYwAlHK6RuPE5hO3mw==","signatures":[{"sig":"MEQCIFtIUWP7r9MnjGYNVtxRwFBa4LyyWrpZUVShVAWwdgv8AiBtzp0orWVDHLw7XGoLPcqEawhalSCZJPDqUcFG2MfVqA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":21222},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"import":{"types":"./dist/index.d.mts","default":"./dist/index.mjs"},"require":{"types":"./dist/index.d.ts","default":"./dist/index.js"}}},"gitHead":"0a146911f9e27e36b1356a19685633ba392c7c10","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"bunchee","prepare":"npm run build","npmpublish":"npm publish --access public","types:check":"tsc --noEmit"},"_npmUser":{"name":"piotr-cz","email":"hello@piotr.cz"},"repository":{"url":"git+https://github.com/piotr-cz/swr-idb-cache.git","type":"git"},"_npmVersion":"9.8.1","description":"IndexedDB Cache Provider for SWR","directories":{},"_nodeVersion":"18.18.2","dependencies":{"idb":"^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"swr":"^2.0.0","react":"^18.0.0","bunchee":"^5.3.2","typescript":"^5.5.4","@types/react":"^18.3.3"},"peerDependencies":{"swr":"^2.0.0-beta.3","react":"^16.11.0 || ^17.0.0 || ^18.0.0"},"_npmOperationalInternal":{"tmp":"tmp/swr-idb-cache_1.1.0_1723812855424_0.4118313344385389","host":"s3://npm-registry-packages"}},"1.1.1":{"name":"@piotr-cz/swr-idb-cache","version":"1.1.1","keywords":["swr","cache","IndexedDB","idb"],"author":{"url":"https://www.piotr.cz","name":"Piotr Konieczny","email":"hello@piotr.cz"},"license":"MIT","_id":"@piotr-cz/swr-idb-cache@1.1.1","maintainers":[{"name":"piotr-cz","email":"hello@piotr.cz"}],"homepage":"https://github.com/piotr-cz/swr-idb-cache","bugs":{"url":"https://github.com/piotr-cz/swr-idb-cache/issues"},"dist":{"shasum":"18e80a034d3744013fad7233a48dda0f0e1d18b6","tarball":"https://registry.npmjs.org/@piotr-cz/swr-idb-cache/-/swr-idb-cache-1.1.1.tgz","fileCount":7,"integrity":"sha512-+FFXcu39If7ntfe9TCE7Si/DFU45Rg83iapgfjFd2X9uc8MHm47S5cBHIr3CiDQEu6fR0xLZ7UpkUXPaH3kn7g==","signatures":[{"sig":"MEUCIGo4FL0JhMKTgDy/FvhY2/IwcBawqQ/4ctHwwAbngkpWAiEAu1eXwDY+c38Cl9loeO5WnHvc1TaW5DPvFzhsJ+yzN2k=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":22027},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"import":{"types":"./dist/index.d.mts","default":"./dist/index.mjs"},"require":{"types":"./dist/index.d.ts","default":"./dist/index.js"}}},"gitHead":"546ce54cf1432e56020001b8751670a698940f7b","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"bunchee","prepare":"npm run build","npmpublish":"npm publish --access public","types:check":"tsc --noEmit"},"_npmUser":{"name":"piotr-cz","email":"hello@piotr.cz"},"repository":{"url":"git+https://github.com/piotr-cz/swr-idb-cache.git","type":"git"},"_npmVersion":"9.8.1","description":"IndexedDB Cache Provider for SWR","directories":{},"_nodeVersion":"18.18.2","dependencies":{"idb":"^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"swr":"^2.0.0","react":"^18.0.0","bunchee":"^5.3.2","typescript":"^5.5.4","@types/react":"^18.3.3"},"peerDependencies":{"swr":"^2.0.0-beta.3","react":"^16.11.0 || ^17.0.0 || ^18.0.0"},"_npmOperationalInternal":{"tmp":"tmp/swr-idb-cache_1.1.1_1730363540837_0.9197638690331438","host":"s3://npm-registry-packages"}},"1.1.2":{"name":"@piotr-cz/swr-idb-cache","version":"1.1.2","description":"IndexedDB Cache Provider for SWR","main":"./dist/index.js","module":"./dist/index.mjs","types":"./dist/index.d.ts","exports":{".":{"import":{"types":"./dist/index.d.mts","default":"./dist/index.mjs"},"require":{"types":"./dist/index.d.ts","default":"./dist/index.js"}}},"repository":{"type":"git","url":"git+https://github.com/piotr-cz/swr-idb-cache.git"},"author":{"name":"Piotr Konieczny","email":"hello@piotr.cz","url":"https://www.piotr.cz"},"homepage":"https://github.com/piotr-cz/swr-idb-cache","license":"MIT","keywords":["swr","cache","IndexedDB","idb"],"scripts":{"build":"bunchee","npmpublish":"npm publish","prepare":"npm run build","types:check":"tsc --noEmit","test":"echo \"Error: no test specified\" && exit 1"},"dependencies":{"idb":"^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0"},"devDependencies":{"@types/react":"^18.3.3","bunchee":"^5.3.2","react":"^18.0.0","swr":"^2.0.0","typescript":"^5.5.4"},"peerDependencies":{"react":"^16.11.0 || ^17.0.0 || ^18.0.0 || ^19.0.0","swr":"^2.0.0-beta.3"},"publishConfig":{"access":"public"},"_id":"@piotr-cz/swr-idb-cache@1.1.2","gitHead":"67fcc34f5cdb75b98aec210057f526950bf171a7","bugs":{"url":"https://github.com/piotr-cz/swr-idb-cache/issues"},"_nodeVersion":"18.18.2","_npmVersion":"9.8.1","dist":{"integrity":"sha512-30JFSCUtuEpazU1qHsX06qdTq+64PjggaROe8pKXgy7ZVHmpU5Ir1ItbhVBYZq/27U5xlGX+xmL+I44Pp9pIOQ==","shasum":"a51d506a403267bfb1b88ff7f1853522760587ff","tarball":"https://registry.npmjs.org/@piotr-cz/swr-idb-cache/-/swr-idb-cache-1.1.2.tgz","fileCount":7,"unpackedSize":22078,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDM38OyxhGNHFvgkeQ/EaIQEWrBNBcLwTWaHSjIOhpBCQIgbC5EROjRR5OlHT76IzOFb3rogmVFt6V0zbC7z+IBHck="}]},"_npmUser":{"name":"piotr-cz","email":"hello@piotr.cz"},"directories":{},"maintainers":[{"name":"piotr-cz","email":"hello@piotr.cz"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/swr-idb-cache_1.1.2_1736332495071_0.5096766757556632"},"_hasShrinkwrap":false}},"time":{"created":"2022-10-12T14:31:42.482Z","modified":"2025-01-08T10:34:55.483Z","1.0.0-rc.1":"2022-10-12T14:31:42.708Z","1.0.0-rc.2":"2022-10-19T07:15:54.220Z","1.0.0-rc.3":"2022-11-23T14:24:53.738Z","1.0.0":"2022-12-30T10:01:29.972Z","1.0.1":"2023-06-06T13:31:03.389Z","1.0.2":"2024-03-09T18:36:22.337Z","1.0.3":"2024-04-22T07:39:47.838Z","1.1.0":"2024-08-16T12:54:15.615Z","1.1.1":"2024-10-31T08:32:21.013Z","1.1.2":"2025-01-08T10:34:55.289Z"},"bugs":{"url":"https://github.com/piotr-cz/swr-idb-cache/issues"},"author":{"name":"Piotr Konieczny","email":"hello@piotr.cz","url":"https://www.piotr.cz"},"license":"MIT","homepage":"https://github.com/piotr-cz/swr-idb-cache","keywords":["swr","cache","IndexedDB","idb"],"repository":{"type":"git","url":"git+https://github.com/piotr-cz/swr-idb-cache.git"},"description":"IndexedDB Cache Provider for SWR","maintainers":[{"name":"piotr-cz","email":"hello@piotr.cz"}],"readme":"# IndexedDB Cache Provider for [SWR](https://swr.vercel.app/)\n\nSynchronize SWR Cache with [IndexedDB](https://developer.mozilla.org/en-US/docs/Glossary/IndexedDB) to get offline cache.\n\nExamples of use cases include situations where you want to provide a fallback solution for fetch requests\nright after your app launches (when offline or with an unstable internet connection):\n\n- Progressive Web Apps\n- [Capacitor](https://capacitorjs.com/) Apps\n\nPlease note that the cache provider initialization process is asynchronous and until it's resolved, best practise is to render fallback component.\n\n> [!WARNING]\n> When passing secrets such as an API token to fetcher ([example](https://swr.vercel.app/docs/arguments)),\n> it will be saved in the persistent cache as a part of key generated by [stable-hash](https://github.com/shuding/stable-hash).\n>\n> To overcome this, you may use custom comparision function in SWR Config that replaces secret by it's checksum.\n\n## How does it work?\n\nLibrary reads current state of cache stored in [IndexedDB](https://developer.mozilla.org/en-US/docs/Glossary/IndexedDB) into memory using [idb](https://github.com/jakearchibald/idb) during it's initialization.\nThen it resolves into Cache Provider which should be passed to SWR.\n\nRead SWR Docs > [Cache](https://swr.vercel.app/docs/advanced/cache) if your are interested in more information about implementation details.\n\n\n## Installation\n\nUsing npm:\n\n```console\nnpm install --save @piotr-cz/swr-idb-cache\n```\n\nor Yarn:\n\n```console\nyarn add @piotr-cz/swr-idb-cache\n\n```\n\n\n## Requirements\n\n- [SWR](https://swr.vercel.app/) ^2.0.0  \n  *Note: For SWR 1.x use the 1.0.0-rc.2 version of this package*\n- Works with [React](https://reactjs.org/) ^16.11 and [Preact](https://preactjs.com/)\n\n## Setup\n\nInitialize library and when it's ready, pass it in configuration under `provider` key to SWR.\n\nTo wait until provider is resolved, use bundled `useCacheProvider` hook:\n\n```jsx\n// App.jsx\nimport { SWRConfig } from 'swr'\nimport { useCacheProvider } from '@piotr-cz/swr-idb-cache'\n\nfunction App() {\n  // Initialize\n  const cacheProvider = useCacheProvider({\n    dbName: 'my-app',\n    storeName: 'swr-cache',\n  })\n\n  // Cache Provider is being initialized - render fallback component in the meantime\n  if (!cacheProvider) {\n    return <div>Initializing cache…</div>\n  }\n\n  return (\n    <SWRConfig value={{\n      provider: cacheProvider,\n    }}>\n      <Dashboard />\n    </SWRConfig>\n  )\n}\n```\n\n…or library like [react-use-promise](https://github.com/bsonntag/react-use-promise):\n\n```js\nimport createCacheProvider from '@piotr-cz/swr-idb-cache'\nimport usePromise from 'react-use-promise'\n\nfunction App() {\n  // Initialize\n  const [ cacheProvider ] = usePromise(() => createCacheProvider({\n    dbName: 'my-app',\n    storeName: 'swr-cache',\n  }), [])\n\n  // …\n}\n\n```\n\n\n## Configuration\n\n- `dbName`: IndexedDB Database name\n- `storeName`: IndexedDB Store name\n- `storageHandler` (optional): Custom Storage handler, see [IStorageHandler interface](./src/types.ts#L31)\n- `version` (optional): Schema version, defaults to `1`\n- `onError` (optional): Database error handler, defaults to noop function\n\nNote: When using `useCacheProvider`, changing options doesn't create new cache provider.\n\n## Known issues\n\n\n### InvalidStateError\n\n```\nInvalidStateError\nFailed to execute 'transaction' on 'IDBDatabase': The database connection is closing.\n```\n\nSee idb [Issue #229](https://github.com/jakearchibald/idb/issues/229)\n\n\n## Recipes\n\n\n### Delete cache entry\n\n```jsx\nimport useSWR, { useSWRConfig } from 'swr'\n\nexport default function Item() {\n  const { data, error } = useSWR('/api/data')\n  const { cache } = useSWRConfig()\n\n  const handleRemove = () => {\n    // Remove from state\n    // …\n\n    // Remove from cache with key used in useSWR hook\n    cache.delete('/api/data')\n  }\n\n  return (\n    <main>\n      {/** Show item */}\n      {data &&\n        <h1>{data.label}</h1>\n      }\n\n      {/** Remove item */}\n      <button onClick={handleRemove}>\n        Remove\n      </button>\n    </main>\n  )\n}\n```\n\n\n### Implement Garbage Collector\n\nDefine custom storage handler that extends timestamp storage\n\n```js\n// custom-storage-handler.js\nimport { timestampStorageHandler } from '@piotr-cz/swr-idb-cache'\n\n// Define max age of 7 days\nconst maxAge = 7 * 24 * 60 * 60 * 1e3\n\nconst gcStorageHandler = {\n  ...timestampStorageHandler,\n  // Revive each entry only when it's timestamp is newer than expiration\n  revive: (key, storeObject) => \n    storeObject.ts > Date.now() - maxAge\n      // Unwrapped value\n      ? timestampStorageHandler.revive(key, storeObject)\n      // Undefined to indicate item is stale\n      : undefined,\n}\n\nexport default gcStorageHandler\n```\n\nPass it to configuration\n\n```diff\n // App.jsx\n import { SWRConfig } from 'swr'\n import { useCacheProvider } from '@piotr-cz/swr-idb-cache'\n\n+import customStorageHandler from './custom-storage-handler.js'\n+\n function App() {\n   // Initialize\n   const cacheProvider = useCacheProvider({\n     dbName: 'my-app',\n     storeName: 'swr-cache',\n+    storageHandler: customStorageHandler,\n   })\n\n   // …\n```\n\n\n### Ignore API endpoints from cache persistence\n\nDefine custom storage handler that extends timestamp storage\n\n```js\n// custom-storage-handler.js\nimport { timestampStorageHandler } from '@piotr-cz/swr-idb-cache'\n\nconst blacklistStorageHandler = {\n  ...timestampStorageHandler,\n  // Ignore entries fetched from API endpoints starting with /api/device\n  replace: (key, value) =>\n    !key.startsWith('/api/device/')\n      // Wrapped value\n      ? timestampStorageHandler.replace(key, value)\n      // Undefined to ignore storing value\n      : undefined,\n}\n\nexport default blacklistStorageHandler\n```\n\nPass it in configuration as in the [recipe above](#implement-garbage-collector)\n\n### Mocking package in tests\n\n- Use mock IndexedDB\n\n  ```shell\n  npm install --save-dev fake-indexeddb\n  ```\n\n  ```ts\n  // src/setupTests.ts\n  import 'fake-indexeddb/auto'\n  ```\n\n  or\n\n- Add mock cache provider with [vitest](https://vitest.dev/)\n\n  ```ts\n  // src/App.test.tsx\n  type SWRIdbCacheExports = typeof import('@piotr-cz/swr-idb-cache')\n\n  vi.mock('@piotr-cz/swr-idb-cache', async (importOriginal): Promise<SWRIdbCacheExports> => {\n    const mod = await importOriginal<SWRIdbCacheExports>()\n\n    return {\n      ...mod,\n      useCacheProvider: () => () => new Map(),\n    }\n  })\n  ```\n","readmeFilename":"README.md"}