{"_id":"@ctechhindi/pinia-storage","_rev":"1-656c83512efd504ffef3e5725d99784a","name":"@ctechhindi/pinia-storage","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"@ctechhindi/pinia-storage","version":"1.0.0","description":"Store Vue 3 Store data in the browser LocalStorage","homepage":"https://github.com/ctechhindi/Pinia-Storage","bugs":{"url":"https://github.com/ctechhindi/Pinia-Storage/issues"},"email":"ctechhindi@gmail.com","main":"src/index.js","module":"src/index.js","repository":{"type":"git","url":"git+https://github.com/ctechhindi/Pinia-Storage.git"},"scripts":{"dev":"vite","build":"vite build","preview":"vite preview --port 4173","publish":"npm publish --access public"},"keywords":["vue3","pinia","pinia-storage","storage","vue","ctechhindi"],"author":{"name":"Jeevan Lal"},"license":"MIT","devDependencies":{"@vitejs/plugin-vue":"^3.0.3","vite":"^3.0.9","vue":"^3.2.38","vue-router":"^4.1.5"},"gitHead":"8fff94af8abe2cd3bc8291acf15b2f3ee4df8d1e","_id":"@ctechhindi/pinia-storage@1.0.0","_nodeVersion":"16.16.0","_npmVersion":"8.15.1","dist":{"integrity":"sha512-zMmWZZtWou0N1e9ICe4zYyOkYgw4gOHl/fzIC6pHKklYrBKdnLL9O41vPSlY9Y8pg88WhCDOa9pCwJCcY6rGvQ==","shasum":"5cd06de28eef7c942668549e28f03f18aaede7ad","tarball":"https://registry.npmjs.org/@ctechhindi/pinia-storage/-/pinia-storage-1.0.0.tgz","fileCount":4,"unpackedSize":4589,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBVYNsnDK31QfFUjbVOfyak3VyHPUITHz1nKiw1j0YtRAiBL4UrB+ZJ65vUxY5ijH/CrKwsClqKgTNkIy9kGXb7yNw=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjQ837ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr4OA/+KWzHnbGLqtDBNRxe5ohwFkYCljUeaZLkb28bKEK9rQI2PaSA\r\naNZU15uCd8fyZvrH0bwG/Jfl6+lZgWwh9LrBinNuWkWZwqulwnEmGB2pDP3P\r\n9uqjri+t6rKSPoxsXhNplgtM2CQqCJEouTE+fiQ4qvkm1R7YA4DoDxx9aTle\r\nUPy0oGO49dOE1XoirY2mn2N0QaRrpMFBW8MPRXOJrJATu0D3srkwgyFX1eqM\r\nv2bOseYC+OykSE/uzyd5GLPVM7x+gPDQYeXRbCEBlmsF15KMc1otk7CB7PGl\r\nsTzHRApTH1UGx0qzAa6GhsVHL4SNwMZIcLWSxiUInzX5fuG/+oowG1PcISgQ\r\nlSiIumcocF6mBhBYnv671AuttvafoAl0rfSw5LWtTiI7zbc+1Lyf8ePxp/tl\r\ncYnuZXj5MWFyNAHaO2u9E9opERNBVN3LhpJjhifGgIgF8WkyaZjSmOqgXmNh\r\nvxyD+98Hom1Qg7fdQwuEiL8nby/zqAOU3sLL0+KiR2ps7EoVvay+ZNTaDjft\r\nYYzLaPIltIxpvpJOJhOwEPADu7u6hGtBI9z8XLG+SIsLAraFqVFsMKLizLUv\r\nWWU4q9G8O3OQyRZajbnXEBPHVNIYVLoioARJaKhymZ9w+igkbZcMgWToyBw4\r\nuaI5IT2DatPUEMAZbub48jkYZKkGfgtxplg=\r\n=r3ey\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"ctechhindi","email":"ctechhindi@gmail.com"},"directories":{},"maintainers":[{"name":"ctechhindi","email":"ctechhindi@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/pinia-storage_1.0.0_1665388026777_0.19987693896956582"},"_hasShrinkwrap":false},"1.0.1":{"name":"@ctechhindi/pinia-storage","version":"1.0.1","description":"Store Vue 3 Store data in the browser LocalStorage","homepage":"https://github.com/ctechhindi/Pinia-Storage","bugs":{"url":"https://github.com/ctechhindi/Pinia-Storage/issues"},"email":"ctechhindi@gmail.com","main":"src/index.js","module":"src/index.js","repository":{"type":"git","url":"git+https://github.com/ctechhindi/Pinia-Storage.git"},"scripts":{"dev":"vite","build":"vite build","preview":"vite preview --port 4173","publish":"npm publish --access public"},"keywords":["vue3","pinia","pinia-storage","storage","vue","ctechhindi"],"author":{"name":"Jeevan Lal"},"license":"MIT","devDependencies":{"@vitejs/plugin-vue":"^3.0.3","vite":"^3.0.9","vue":"^3.2.38","vue-router":"^4.1.5"},"gitHead":"356588d3458e6836e5f1ec9bb90b20c9ddea43b8","_id":"@ctechhindi/pinia-storage@1.0.1","_nodeVersion":"16.16.0","_npmVersion":"8.15.1","dist":{"integrity":"sha512-tkDkpG6VrT3utEyaLL78eaYmDbMWGlPG93Jxi/76oJF7clIa+6ajqFlytRG4ak6PDnfe/KxwRAJ0b0+m3RD2rA==","shasum":"18913dc100a69a6d3c9c2fae5a26752629750a1a","tarball":"https://registry.npmjs.org/@ctechhindi/pinia-storage/-/pinia-storage-1.0.1.tgz","fileCount":4,"unpackedSize":4606,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCID/VY1zRuqYDV2UjslWS+h+G96eqzi4SVfu7SNGpVFKYAiEA4SYqOP5RoJZjM0Z4M/BdmjL4VsMl2qxtq5ZrXogGdBY="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjQ88QACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqa3w//QDD4/iolqICmpKeiZyRtRqU/DdlIgHu9dAq3W8Gzaaogl3M1\r\no7GZcDARlo04DVG4/9wX77OiE5hzgXLxPicqFu42rJtYr7833tOW06E6AF7o\r\nfV0t9ZwfSeNBt2b6keiClRy/m6xZilfp1Mg6LKjhd0VMM72YLBh+EX7euzaO\r\nZJvs9q7pY252TxCfRPGT0GuOYdkeyaPmS/8xMYECu34fasjjTd+mdVQUyLSt\r\nU4UU0eyiCuoIcAXXtJeDRbjTJoFJfn3XTc5mckZkoHqzqTBvR6U4+IiAsQ0f\r\n+av65UXOhape0pFL5FXrePOmKx1ti1RmMvi+75AD8tZHSJg12Xf0Y+x6aHuE\r\n/WxtdMqJ9v50XXt2m6hQ2Symm0SAg0XJMV9CzOUf6IljzqfjaaAqMg9xvdiq\r\njvz7UCTXOU//eHdVdnSaTD1gOMx4iuTMQh7H/Nrt7uakOzvm4L+Yl4XB+TY+\r\n4a2lV1LN/fl1ae8fkvHQUNBWG4LUNq4IGR9lMDWD+25lEeCemRSXGljQyeiW\r\ncxd16M3C2tdhMoiuI9WH4tyT7d1IqcpdUyUSLcxlvEOMyWmAIuVBwl8c5xJG\r\nHKrPOQOBKDyVHXdxDn6oHB4QRSY9wrlv7LyYoy7cgA7wmaZqAmQr+ovfEVtV\r\nbLRikLrV1+rq+k2fkymsBq/nb4gc5oykJP4=\r\n=A/Tj\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"ctechhindi","email":"ctechhindi@gmail.com"},"directories":{},"maintainers":[{"name":"ctechhindi","email":"ctechhindi@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/pinia-storage_1.0.1_1665388304030_0.9277501996250637"},"_hasShrinkwrap":false}},"time":{"created":"2022-10-10T07:47:06.708Z","1.0.0":"2022-10-10T07:47:07.015Z","modified":"2022-10-10T07:51:44.319Z","1.0.1":"2022-10-10T07:51:44.240Z"},"maintainers":[{"name":"ctechhindi","email":"ctechhindi@gmail.com"}],"description":"Store Vue 3 Store data in the browser LocalStorage","homepage":"https://github.com/ctechhindi/Pinia-Storage","keywords":["vue3","pinia","pinia-storage","storage","vue","ctechhindi"],"repository":{"type":"git","url":"git+https://github.com/ctechhindi/Pinia-Storage.git"},"author":{"name":"Jeevan Lal"},"bugs":{"url":"https://github.com/ctechhindi/Pinia-Storage/issues"},"license":"MIT","readme":"# Pinia Storage\r\n\r\n![npm license](https://img.shields.io/npm/l/@ctechhindi/pinia-storage.svg)\r\n![npm download](https://img.shields.io/npm/dm/@ctechhindi/pinia-storage.svg)\r\n![GitHub top language](https://img.shields.io/github/languages/top/ctechhindi/pinia-storage.svg)\r\n![GitHub issues](https://img.shields.io/github/issues/ctechhindi/pinia-storage.svg)\r\n[![npm package](https://img.shields.io/npm/v/@ctechhindi/pinia-storage.svg)](https://www.npmjs.com/package/@ctechhindi/pinia-storage)\r\n\r\n> Store Vue 3 Store data in the browser LocalStorage\r\n\r\n- [GitHub](https://github.com/ctechhindi/Pinia-Storage)\r\n\r\n## Requirements\r\n\r\n- Vue.js `^3.0.0`\r\n\r\n## Installation\r\n\r\n### npm\r\n\r\n```\r\nnpm i @ctechhindi/pinia-storage\r\n```\r\n\r\n## Usage\r\n\r\n**`main.js`**\r\n\r\n```js\r\nimport piniaStorage from \"@ctechhindi/pinia-storage\";\r\nconst pinia = createPinia();\r\npinia.use(piniaStorage);\r\n```\r\n\r\n**`\\stores\\{sites}-store.js`**\r\n\r\n```js\r\nimport { defineStore } from \"pinia\";\r\n\r\nexport const useUsersStore = defineStore({\r\n  id: \"users-store\",\r\n  state: () => ({\r\n    name: {\r\n      first: \"\",\r\n      last: \"\",\r\n    },\r\n  }),\r\n  conserve: {\r\n    enabled: true,\r\n    strategies: [\r\n      { storage: localStorage, states: [\"name\"] }, // Save custom state\r\n      // { storage: localStorage, }, // Save all state\r\n      // { storage: sessionStorage, states: ['name'] },\r\n    ],\r\n  },\r\n  getters: {},\r\n  actions: {},\r\n});\r\n```\r\n\r\n### Custom LocalStorage\r\n\r\n**`\\stores\\{sites}-store.js`**\r\n\r\n```js\r\nimport { defineStore } from \"pinia\";\r\n\r\n// Custom\r\nconst secureStorage = {\r\n  setItem(key, state) {\r\n    localStorage.setItem(key, state)\r\n  },\r\n  getItem(key) {\r\n    localStorage.getItem(key, state)\r\n  },\r\n}\r\n\r\nexport const useUsersStore = defineStore({\r\n  id: \"users-store\",\r\n  state: () => ({\r\n    name: {\r\n      first: \"\",\r\n      last: \"\",\r\n    },\r\n  }),\r\n  conserve: {\r\n    enabled: true,\r\n    strategies: [\r\n      { storage: secureStorage, states: [\"name\"] }, // Save custom state\r\n    ],\r\n  },\r\n  getters: {},\r\n  actions: {},\r\n});\r\n```\r\n\r\n# License\r\n\r\n[MIT License](https://opensource.org/licenses/MIT)\r\n","readmeFilename":"README.md"}