{"_id":"@authory/use-web-storage-hook","_rev":"2-4521841cdc367f4fc89e3561cf3c10e4","name":"@authory/use-web-storage-hook","dist-tags":{"latest":"1.1.0"},"versions":{"1.0.0":{"name":"@authory/use-web-storage-hook","version":"1.0.0","keywords":["react","hook","storage","localstorage","sessionstorage","useWebStorage"],"author":{"name":"John Titor"},"license":"Copyleft","_id":"@authory/use-web-storage-hook@1.0.0","maintainers":[{"name":"authory","email":"johntitortheprogrammer@gmail.com"}],"homepage":"https://github.com/johntitor/use-web-storage-hook#readme","bugs":{"url":"https://github.com/johntitor/use-web-storage-hook/issues"},"dist":{"shasum":"7c939eb6ec82d9080802535c7a527796fa1667e3","tarball":"https://registry.npmjs.org/@authory/use-web-storage-hook/-/use-web-storage-hook-1.0.0.tgz","fileCount":4,"integrity":"sha512-9pl+HJBYD6imu58oycyRoytVp5IVl40H37opPT+xUYHbIvItvuZInvlAyAajce3U11SbxMj8f1P3GZV2SF/nLQ==","signatures":[{"sig":"MEUCIQCOq3gYs8D3G3i+q46FvG/6rykagswTx157Ni8Ly2K07AIgEPjg54rROfJjJrh6WPcjtceRrlEaxBxEoO6DMA1m1EY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":4369},"main":"dist/use-web-storage.cjs.js","types":"dist/use-web-storage.d.ts","module":"dist/use-web-storage.esm.js","gitHead":"6c933bd929798161b430636ba5da90d0faec8306","scripts":{"build":"vite build","prepare":"npm run build"},"_npmUser":{"name":"authory","email":"johntitortheprogrammer@gmail.com"},"repository":{"url":"git+https://github.com/johntitor/use-web-storage-hook.git","type":"git"},"_npmVersion":"11.6.2","description":"React hook for smart localStorage/sessionStorage with expiry and cross-tab sync.","directories":{},"_nodeVersion":"23.9.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^4.0.0","typescript":"^4.0.0","vite-plugin-dts":"^4.5.4","semantic-release":"^24.2.9","@vitejs/plugin-react":"^3.0.0","@semantic-release/git":"^10.0.1","@semantic-release/npm":"^12.0.2","@semantic-release/github":"^11.0.6","conventional-changelog-conventionalcommits":"^9.1.0"},"peerDependencies":{"react":">=17.0.0"},"_npmOperationalInternal":{"tmp":"tmp/use-web-storage-hook_1.0.0_1762197432790_0.09033351850687876","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@authory/use-web-storage-hook","version":"1.1.0","description":"React hook for smart localStorage/sessionStorage with expiry, remove, clear, and cross-tab sync.","main":"dist/use-web-storage.umd.js","module":"dist/use-web-storage.es.js","types":"dist/index.d.ts","scripts":{"build":"vite build","prepare":"npm run build"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/johntitor08/useWebStorageHook.git"},"peerDependencies":{"react":">=17.0.0"},"keywords":["react","hook","storage","localstorage","sessionstorage","useWebStorage","react-hook"],"author":{"name":"John Titor","email":"authory"},"license":"Copyleft","devDependencies":{"@semantic-release/changelog":"^6.0.3","@semantic-release/commit-analyzer":"^13.0.1","@semantic-release/git":"^10.0.1","@semantic-release/github":"^11.0.6","@semantic-release/npm":"^12.0.2","@semantic-release/release-notes-generator":"^14.1.0","@vitejs/plugin-react":"^3.0.0","conventional-changelog-conventionalcommits":"^9.1.0","dotenv":"^17.2.3","semantic-release":"^24.2.9","typescript":"^4.0.0","vite":"^4.0.0","vite-plugin-dts":"^4.5.4"},"gitHead":"433aaf1bcd4af3726b58399ea00456d27af65a9d","_id":"@authory/use-web-storage-hook@1.1.0","bugs":{"url":"https://github.com/johntitor08/useWebStorageHook/issues"},"homepage":"https://github.com/johntitor08/useWebStorageHook#readme","_nodeVersion":"23.9.0","_npmVersion":"11.6.2","dist":{"integrity":"sha512-XOTK2GjmIxQbpAuL3lDZDiQ+DYtiKRrELr7W4i/4j/vISH6pXe8LdqRWvlTOOtGANVmyCS9dOwchKirIfvfwuQ==","shasum":"7e691a476ccc264559501a0531339f8259c53678","tarball":"https://registry.npmjs.org/@authory/use-web-storage-hook/-/use-web-storage-hook-1.1.0.tgz","fileCount":4,"unpackedSize":5110,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIBbQmXuXIOaa7SrXWRoCmFx4UnSsTq/WPFH3/9u0x1KtAiEAtqfk1jyXT//k2KYK/J7dzvELzk/YTDvTD+5wXhQsKng="}]},"_npmUser":{"name":"authory","email":"johntitortheprogrammer@gmail.com"},"directories":{},"maintainers":[{"name":"authory","email":"johntitortheprogrammer@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/use-web-storage-hook_1.1.0_1762203736621_0.8962895082365152"},"_hasShrinkwrap":false}},"time":{"created":"2025-11-03T19:17:12.707Z","modified":"2025-11-03T21:02:17.078Z","1.0.0":"2025-11-03T19:17:12.990Z","1.1.0":"2025-11-03T21:02:16.872Z"},"bugs":{"url":"https://github.com/johntitor08/useWebStorageHook/issues"},"author":{"name":"John Titor","email":"authory"},"license":"Copyleft","homepage":"https://github.com/johntitor08/useWebStorageHook#readme","keywords":["react","hook","storage","localstorage","sessionstorage","useWebStorage","react-hook"],"repository":{"type":"git","url":"git+https://github.com/johntitor08/useWebStorageHook.git"},"description":"React hook for smart localStorage/sessionStorage with expiry, remove, clear, and cross-tab sync.","maintainers":[{"name":"authory","email":"johntitortheprogrammer@gmail.com"}],"readme":"# useWebStorage\r\n\r\nA React hook for smart localStorage/sessionStorage with expiry, remove, clear, and cross-tab sync support.\r\n\r\n## Installation\r\n\r\n```bash\r\nnpm install @authory/use-web-storage-hook\r\n```\r\n\r\n## Example Usage\r\n\r\n```bash\r\n\r\nimport { useWebStorage } from \"@authory/use-web-storage-hook\";\r\n\r\nfunction App() {\r\n  const [theme, setTheme] = useWebStorage(\"theme\", \"light\");\r\n\r\n  return (\r\n    <div>\r\n      <h2>Theme: {theme}</h2>\r\n      <button onClick={() => setTheme(theme === \"light\" ? \"dark\" : \"light\")}>\r\n        Toggle\r\n      </button>\r\n    </div>\r\n  );\r\n}\r\n```\r\n\r\n### 🚀 Publishing\r\n\r\n```bash\r\nnpm login\r\nnpm publish --access public\r\nnpm install use-web-storage\r\nimport { useWebStorage } from \"@authory/use-web-storage-hook\";\r\n```\r\n\r\n## ✨ Features\r\n\r\n🔁 Works with both localStorage and sessionStorage\r\n\r\n⏱ Supports expiry (auto remove after given time)\r\n\r\n🧹 Provides remove() and clear() helpers\r\n\r\n🔄 Syncs data across browser tabs\r\n\r\n💡 Lightweight, dependency-free\r\n\r\n### API\r\n\r\n```bash\r\nconst [value, setValue, remove, clear] = useWebStorage(key, defaultValue, options);\r\n```\r\n\r\n### Options\r\n\r\n```bash\r\n{\r\n  storage: 'local' | 'session', // default: 'local'\r\n  expiry: 3600 // seconds\r\n}\r\n```\r\n","readmeFilename":"README.md"}