{"_id":"@aytacmalkoc/react-use-storage","_rev":"5-cd9efe5d788dfbf18596a77094c279ee","time":{"created":"2022-07-13T13:20:32.208Z","1.0.1":"2022-07-13T13:18:42.760Z","modified":"2022-07-13T15:50:39.132Z","1.0.0":"2022-07-13T13:20:32.506Z","1.0.2":"2022-07-13T13:39:21.119Z","1.0.3":"2022-07-13T13:47:02.497Z","1.0.4":"2022-07-13T15:50:39.069Z"},"name":"@aytacmalkoc/react-use-storage","dist-tags":{"latest":"1.0.4"},"versions":{"1.0.0":{"name":"@aytacmalkoc/react-use-storage","version":"1.0.0","description":"Basic storage management for React applications using localStorage & hooks.","repository":{"type":"git","url":"git+https://github.com/aytacmalkoc/react-use-storage.git"},"license":"MIT","main":"dist/index.cjs.js","scripts":{"build":"rollup -c","publish":"npm run build && npm publish --access public"},"keywords":["react","use-storage","react hooks","react-cache"],"author":{"name":"Aytac Malkoc","email":"aytacmalkoc@protonmail.com","url":"https://www.aytacmalkoc.com.tr"},"peerDependencies":{"react":">=16.8.0"},"devDependencies":{"@rollup/plugin-typescript":"^8.3.3","react":"^18.2.0","rollup":"^2.46.0","rollup-plugin-typescript2":"^0.32.1","tslib":"^2.4.0","typescript":"^4.7.4"},"dependencies":{"@types/crypto-js":"^4.1.1","crypto-js":"^4.1.1"},"gitHead":"b3f86a86a9e2960454fc15305755528a0c4cc8fb","bugs":{"url":"https://github.com/aytacmalkoc/react-use-storage/issues"},"homepage":"https://github.com/aytacmalkoc/react-use-storage#readme","_id":"@aytacmalkoc/react-use-storage@1.0.0","_nodeVersion":"16.13.0","_npmVersion":"8.5.5","dist":{"integrity":"sha512-F4psLXrE23wXXuYfPNcCwJcBhU3lZknPXZcI4G20+ZB3DmQ7/PLOCeBGYKDWrHeckPKqltcotGNOCQv66wp2hQ==","shasum":"72d3b0c9daca714264393bca12ce27b3a005f8af","tarball":"https://registry.npmjs.org/@aytacmalkoc/react-use-storage/-/react-use-storage-1.0.0.tgz","fileCount":4,"unpackedSize":5441,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBuiuoO/fvRVjiamP8qOLtReV7jbrLjg/eTlxQmViqTbAiEAkvkjtg4PMriwnwMwWdgHlLnYpLQMXTgxyf/z4jd9mpo="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJizsagACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqxiRAAgkJ5t+vy1cA4rzik7kjyDOahE1E6IPcXN5VhiOTcG1ek+2DK\r\nxdeAlpBgxL6Mi6TRBkZAedkNH3ijGiZiJzf6F/iI2RGsvZC2KVaq9R32guLv\r\nm9BLNnKE4YMAJs/wIDFIn9TnD4h6UxttPhhoj+RCg+PvS8MnC494aRGURXq5\r\nRodWZcF4kzBkd/ysLSjH8ZkC4irGSD+buwaoDS2Gzx/9KT/+q/LUQAIDbKCg\r\n99v60H5vXbxmY/VGHAwGR6tSjvt6+IurqzVp0CMF1MtbOpncqHHYKW+cnhP4\r\nRHDx6BPqzbPyTf0zbfd+mj8RvHW+df9iUnJH9wGQm0b/z8X2NWYTUcm5A20a\r\nR25BfGHPH67ydCV6SJGf3TkhtYMHbkdxAj3Cz13NO2cbp26Qy5/cmzxM6LO/\r\n9Ez/BvRcHfaFAU858dvUr8Lxwivv56gFtgun1O6GHtj8KBpIUC8nip8dX/kH\r\nKk00EPGMmIDQwaYRHcpQKqq35ZeTAgG1hknk1H2xwJLd+3M2R3N5SO2FdWwK\r\nR3mAQP/qBNLZ2iRFBTdkszA03n72ySTsqYp2tRB6KJxPObB5UG6WruMrOKyF\r\nxCmg7Lv/z1v5WvXUjRwjZmON039/A52k6YhwF2cxwSMADdwrRg/Pt2TdeFKg\r\nDvbVwAaJmS/r5klWtXbEAe51cM2+vXGV3nQ=\r\n=OCLC\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"aytacmalkoc","email":"desgaytacmalkoc@gmail.com"},"directories":{},"maintainers":[{"name":"aytacmalkoc","email":"desgaytacmalkoc@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-use-storage_1.0.0_1657718432277_0.36382580658355956"},"_hasShrinkwrap":false},"1.0.2":{"name":"@aytacmalkoc/react-use-storage","version":"1.0.2","description":"Basic storage management for React applications using localStorage & hooks.","repository":{"type":"git","url":"git+https://github.com/aytacmalkoc/react-use-storage.git"},"license":"MIT","main":"dist/index.js","scripts":{"build":"rollup -c","publish":"npm run build && npm publish --access public"},"keywords":["react","use-storage","react hooks","react-cache"],"author":{"name":"Aytac Malkoc","email":"aytacmalkoc@protonmail.com","url":"https://www.aytacmalkoc.com.tr"},"peerDependencies":{"react":">=16.8.0"},"devDependencies":{"@rollup/plugin-typescript":"^8.3.3","react":"^18.2.0","rollup":"^2.46.0","rollup-plugin-typescript2":"^0.32.1","tslib":"^2.4.0","typescript":"^4.7.4"},"dependencies":{"@types/crypto-js":"^4.1.1","crypto-js":"^4.1.1"},"gitHead":"7c0954a21c7c782e83c3c9bbea42ea4bd0e6301f","bugs":{"url":"https://github.com/aytacmalkoc/react-use-storage/issues"},"homepage":"https://github.com/aytacmalkoc/react-use-storage#readme","_id":"@aytacmalkoc/react-use-storage@1.0.2","_nodeVersion":"16.13.0","_npmVersion":"8.5.5","dist":{"integrity":"sha512-pLr9hFzZHkLwgpOvsEP0Tjz8Gcog7/XTU9EWAqDZRa2Bbc62wz0gY1l3hhrwaw3UYtuVkGuQN6j7bPcybjhnRw==","shasum":"bd8a21890b39ee433049d8b8e4a90b82db9bd296","tarball":"https://registry.npmjs.org/@aytacmalkoc/react-use-storage/-/react-use-storage-1.0.2.tgz","fileCount":4,"unpackedSize":5437,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH3J3I58J1z2AtQaR9ULtsBd1gAaxnglI51PjyBsXqI/AiEAvQOh+ecouZR6CBtlPHno9WnelQPMw0bd0xKxWyB3lzY="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJizssJACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrCwRAAkj4zD5GzGV5StiQHzcUwJly3+Aa4jwJYTN7tmy/WXMps2I5t\r\nyua0QjlC8Hh8VgoInZ4aVVzlBPsTu1JRsoqpuPK8suX0q9+UCq8tKRipGWJP\r\nIK5Ah8eWpzPFXUYi1hwvLrvHBtJmQaR5tsbcAnxmhUGOU7JxP5a/jPDNaWUJ\r\nuejdeQ+P5vqiPxIX8ek8xxHI8YBNiU+7XuXm+AEO9OD4Abvyv/drCQzK3gUu\r\npUkliIb4g7l551Bz8BGHvR/8zLs/N0txQxnBFLTV6nRDk9zk9kndQx8d3b8U\r\noJEGRlwdYXLWQuS0/nG4k331a24d1acWDnXMrcq0uR8tU9BHDh4xe3BmCt0G\r\nxKRGI/cYjDgvfRYpq4iMCFxrrOYKf2YvLEQXkifq6Y9O031934cPB+mEECbD\r\nU5mTgCocFB7txmoCHJwR2yHYlFEXw4iKqbIpjdqgb95yv7c+swHmxerWXHmL\r\nHQoGeAvkmA7vtlA5SL7t4mcjthxNUOGmb77uCKgPo/bdOtTcAiQR089NMl+7\r\noKeMwrBAnVEkJHuFbe44HBCofP+6+4K7d1QqKy3yZ7k3Mczoiv29rkTtJuh+\r\nSJ5Q0ACquKdMoklQ1FNCnSGlCW1g5S5m2QamgJap3x3MhTfMHUf/+LPeZvmi\r\n49gpiiwVH5ypWWSFezwa6/HGbt2w2eOCYKc=\r\n=J9eh\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"aytacmalkoc","email":"desgaytacmalkoc@gmail.com"},"directories":{},"maintainers":[{"name":"aytacmalkoc","email":"desgaytacmalkoc@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-use-storage_1.0.2_1657719560937_0.04396871632130939"},"_hasShrinkwrap":false},"1.0.3":{"name":"@aytacmalkoc/react-use-storage","version":"1.0.3","description":"Basic storage management for React applications using localStorage & hooks.","repository":{"type":"git","url":"git+https://github.com/aytacmalkoc/react-use-storage.git"},"license":"MIT","main":"dist/index.js","scripts":{"build":"rollup -c","publish":"npm run build && npm publish --access public"},"keywords":["react","use-storage","react hooks","react-cache"],"author":{"name":"Aytac Malkoc","email":"aytacmalkoc@protonmail.com","url":"https://www.aytacmalkoc.com.tr"},"peerDependencies":{"react":">=16.8.0"},"devDependencies":{"@rollup/plugin-typescript":"^8.3.3","react":"^18.2.0","rollup":"^2.46.0","rollup-plugin-typescript2":"^0.32.1","tslib":"^2.4.0","typescript":"^4.7.4"},"dependencies":{"@types/crypto-js":"^4.1.1","crypto-js":"^4.1.1"},"gitHead":"6dab23b57daaed7e1c1ce18d15ade2023b5f2b60","bugs":{"url":"https://github.com/aytacmalkoc/react-use-storage/issues"},"homepage":"https://github.com/aytacmalkoc/react-use-storage#readme","_id":"@aytacmalkoc/react-use-storage@1.0.3","_nodeVersion":"16.13.0","_npmVersion":"8.5.5","dist":{"integrity":"sha512-oRqMUKYes4ujmwcIYkZP+uXnCakKTeVtkIZjItyl3SS18G62EDFqw7xjEd4868YbDS7fAypkPe4yWoe3uNkvhw==","shasum":"2520e92d6d1365b049c0a8352de99f992d329705","tarball":"https://registry.npmjs.org/@aytacmalkoc/react-use-storage/-/react-use-storage-1.0.3.tgz","fileCount":4,"unpackedSize":5493,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHeK0j1pmYJMUKy4H//8VOkzt44WkTQZ0FVUHeiuvMwuAiEAuo5bweUXyxMdvj/HGSs9Q/cOpZMz17jZyi7Xut90//Y="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJizszWACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpoWg/+Lcn2FnEF9/BuVZsJZhqDt/54em6E5f32Tsh5IibRx9CDHGcn\r\nbScl8yRI3Up1OxVu5X+L5rTtee5mKqXZmuxCbyFCWlPL4E040zW3TcwhZhB9\r\nyHvJU46AIxbc4QJTSM2s/Sp7eC4o18Eiy+urtIQF26ebNzLuGMkozPJ4FImO\r\nJGaO6uAdp54KTx/g1IEIwC68k7F+V1JkFhGy/E47sSyVBg4BXNWjVWXqKLCt\r\nzqgYiGHMniUP/xVlkWFldSQ092DILfm0GoLxjHpOmidTmL7cn3Ctnzkz63Vf\r\nh6FcqrGMy/QNGEhDOhsXN/0sN4gkOlcscuvfKqfVxz+PkFR0NDEo2AfBiPQL\r\nDGOFS+hAeDkXpa2sr61LHb0xL3A837GKtjKr/asPAtFlsg70Bu5WSMtUkG2E\r\nR7tTlfGyEiVmXaw1e0usjCCgeZFCYtdQfNNhnx2vDtR3JCw9qBb+kBdQYH94\r\nUZswDBp4btYRNEEm+qU15MUE9DwDFXCHvvm+ZT37h+1meNIkmXuWBktJTi3e\r\nD9r/a3nlZvOKIR4/gQJZ6421LDXt+7uIIDpf8Hj44zrPFmc1Skz5T6CLCIvs\r\n7Vt64f2oQxD0nnMFWCw3NdR6QaQp0dZ/l8lBXh7mvUS9NgiQXEaIdyJEByuM\r\nRmPG3JmgVQCytqNDliatIHZwIi7F/zo1eno=\r\n=QBPT\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"aytacmalkoc","email":"desgaytacmalkoc@gmail.com"},"directories":{},"maintainers":[{"name":"aytacmalkoc","email":"desgaytacmalkoc@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-use-storage_1.0.3_1657720022302_0.5098469901334102"},"_hasShrinkwrap":false},"1.0.4":{"name":"@aytacmalkoc/react-use-storage","version":"1.0.4","description":"Basic storage management for React applications using localStorage & hooks.","repository":{"type":"git","url":"git+https://github.com/aytacmalkoc/react-use-storage.git"},"license":"MIT","main":"dist/index.js","scripts":{"build":"rollup -c","publish":"npm run prettier-format && npm run build && npm publish --access public","lint":"eslint . --ext .ts","prettier-format":"prettier --config .prettierrc src/**/*.ts --write","prettier-watch":"onchange 'src/**/*.ts' -- prettier --write {{changed}}"},"keywords":["react","use-storage","react hooks","react-cache"],"author":{"name":"Aytac Malkoc","email":"aytacmalkoc@protonmail.com","url":"https://www.aytacmalkoc.com.tr"},"peerDependencies":{"react":">=16.8.0"},"devDependencies":{"@rollup/plugin-typescript":"^8.3.3","eslint-config-prettier":"^8.5.0","eslint-plugin-prettier":"^4.2.1","onchange":"^7.1.0","prettier":"^2.7.1","react":"^18.2.0","rollup":"^2.46.0","rollup-plugin-typescript2":"^0.32.1","tslib":"^2.4.0","typescript":"^4.7.4"},"dependencies":{"@types/crypto-js":"^4.1.1","crypto-js":"^4.1.1"},"gitHead":"a37418b9f9c7d1011ec75b177e644805cbf122f7","bugs":{"url":"https://github.com/aytacmalkoc/react-use-storage/issues"},"homepage":"https://github.com/aytacmalkoc/react-use-storage#readme","_id":"@aytacmalkoc/react-use-storage@1.0.4","_nodeVersion":"16.13.0","_npmVersion":"8.5.5","dist":{"integrity":"sha512-1Cv83fZ4s9nKeqNc/oRw0DUPP1MzOjFeduGhfaarUXyqBT+Lf093RXXHWIW0P/uCV06scVkA4lcL1aSHkL8Z1w==","shasum":"f55004fd926c85e470a0337c4406051fa3f0e81f","tarball":"https://registry.npmjs.org/@aytacmalkoc/react-use-storage/-/react-use-storage-1.0.4.tgz","fileCount":6,"unpackedSize":7582,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDOZ6FNNJb+yAzb54wxji/VQHKuN9++H1oKbuowrZ7S7wIhAPsDjzER4Ehl7jtZsW3GM5AslLZledJNepNG9rlIQflN"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJizunPACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrr6Q//T6P+L8LyHR8sj/73XozUIiC0J/KSetNGZJyo47DonKEPGbPe\r\nyMO27yh456kZzC9IiJYz3ksp1GHTGjVMrgpr9JcUL1rVBYll+WN4N/pDSyG+\r\nGiXnWpXja7o4SVOvwtYrP8b8YUUCC8j5OMvNUy0wLpzvr8quvfsX8Q0adCmo\r\n9fVZ5PTrGh561TW4cUxx1aBL3mcT/x6JYuOovEW+RbA6MtvW3SikeAt07TaW\r\nKzR4zTiDmjOTbQSRQM7Bq1tRBfxTYbuS4TO5/hngXDcVpZjQbczsjMlrLMsN\r\n/wgJcGWgptdMQ2n2bQhMA62HiAAq+N3S0PdHgQoLzDMf+7KvuGCQ7QiE5YE7\r\nUun8gH29EoGbK6wtduj5bSqSE8SP4wH/Zp8Hh8gJcnlKju3+chbWAJ8fChLK\r\nO816lQnFTuFbU+gcN5FGiuNR8Dzhdq2AiDRo7h4xSrYjLJMbqb/uqDasnMcO\r\nwWclXFSZBpeb16vUGUp0RI92XfscxTiLoRaQTHTJmF+XjCdREpmrWll7WWFD\r\nQZM9PLlySFCClOS+v9c0wtQ9/FC5crmIZ1Y6tXYHGzx3toz5I2tNcbnZnSsN\r\nlctYRA5J1UWuaUXo+vJ2kkfeccxLFQp8K+pPJCx4OpGR+sclSX2JYmPKNXp+\r\n/ejqjNwPjvSWgVYl/8CCaqV/ud9rd5RBOS0=\r\n=P4jp\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"aytacmalkoc","email":"desgaytacmalkoc@gmail.com"},"directories":{},"maintainers":[{"name":"aytacmalkoc","email":"desgaytacmalkoc@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-use-storage_1.0.4_1657727438868_0.30773681139430775"},"_hasShrinkwrap":false}},"maintainers":[{"name":"aytacmalkoc","email":"desgaytacmalkoc@gmail.com"}],"description":"Basic storage management for React applications using localStorage & hooks.","homepage":"https://github.com/aytacmalkoc/react-use-storage#readme","keywords":["react","use-storage","react hooks","react-cache"],"repository":{"type":"git","url":"git+https://github.com/aytacmalkoc/react-use-storage.git"},"author":{"name":"Aytac Malkoc","email":"aytacmalkoc@protonmail.com","url":"https://www.aytacmalkoc.com.tr"},"bugs":{"url":"https://github.com/aytacmalkoc/react-use-storage/issues"},"license":"MIT","readme":"# 📖 react-use-storage\r\n\r\nThe react-use-storage package makes it easy to store data from API services with localStorage.\r\n\r\n[![npm downloads](https://img.shields.io/npm/dt/@aytacmalkoc/react-use-storage)](https://www.npmjs.com/package/@aytacmalkoc/react-use-storage)\r\n[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/aytacmalkoc/react-use-storage/blob/main/LICENSE)\r\n\r\n# Table of contents\r\n\r\n- [📖 react-use-storage](#-react-use-storage)\r\n  - [🙇‍♂️ Motivation](#-motivation)\r\n  - [🔗 Installation](#-installation)\r\n  - [👉 Usage](#-usage)\r\n  - [Parameters](#parameters)\r\n  - [🔑 Encryption](#-encryption)\r\n  - [Formatting](#formatting)\r\n    - [📝 Lint](#-lint)\r\n    - [👀 Watch changes](#-watch-changes)\r\n    - [✒️ Format Document](#-format-document)\r\n  - [🚀 Build & Publish](#-build--publish)\r\n    - [Build](#build)\r\n    - [Publish](#publish)\r\n  - [💁 License](#-license)\r\n\r\n## 🙇‍♂️ Motivation\r\nI had the problem that this package solves while developing my personal web page. I wanted to list my personal repository on my web page using Github REST API service. I wanted to write a function using the localStorage property to be able to do it without any authenticate and rate limits. When I saw that I could use this function in more than one project, I created it as a small package and published it.\r\n\r\n## 🔗 Installation\r\n\r\n```bash\r\nyarn add @aytacmallkoc/react-use-storage\r\n```\r\nor\r\n\r\n```bash\r\nnpm install @aytacmalkoc/react-use-storage\r\n```\r\n\r\n## 👉 Usage\r\n\r\n```js\r\nimport { useStorage } from '@aytacmalkoc/react-use-storage';\r\n\r\nconst [posts, setPosts] = useState([]);\r\nconst [storage, setStorage] = useStorage('posts');\r\n\r\nuseEffect(() => {\r\n    if (storage) {\r\n        setPosts(storage);\r\n    } else {\r\n        // fetch data from server\r\n        fetch('https://jsonplaceholder.typicode.com/posts')\r\n            .then(response => response.json())\r\n            .then(data => {\r\n                setPosts(data);\r\n                setStorage(data);\r\n            });\r\n    }\r\n}, []);\r\n```\r\n\r\n## Parameters\r\n\r\n| **Parameter** | **Type** | **Required** | **Description**                          |\r\n|---------------|----------|--------------|------------------------------------------|\r\n| key           | string   | yes          | Key name to use in localStorage          |\r\n| encrypt       | boolean  | no           | Encrypt data for security. Default false |\r\n\r\n\r\n## 🔑 Encryption\r\n\r\nreact-use-storage does not encrypt data by default. The second parameter must be true to encrypt the data.\r\n\r\n[crypto-js](https://www.npmjs.com/package/crypto-js) package and [AES](https://en.wikipedia.org/wiki/Advanced_Encryption_Standard) algorithm are used when encrypting data.\r\n\r\n\r\n## Formatting\r\n\r\n### 📝 Lint\r\n\r\n```bash\r\nyarn lint\r\n```\r\n\r\n### 👀 Watch changes\r\n\r\n```bash\r\nyarn prettier-watch\r\n```\r\n\r\n### ✒️ Format Document\r\n\r\n```bash\r\nyarn prettier-format\r\n```\r\n---\r\n\r\n## 🚀 Build & Publish\r\n\r\n\r\n### Build\r\n\r\n```bash\r\nyarn build\r\n```\r\n### Publish\r\n```bash\r\nyarn publish\r\n```\r\n\r\n## 💁 License\r\nMIT license, Copyright (c) Aytac Malkoc. For more information see [LICENSE](https://github.com/aytacmalkoc/react-use-storage/blob/main/LICENSE).\r\n","readmeFilename":"README.md"}