{"_id":"pinia-persist","_rev":"3-bae5f5da603bdc912c216591300e2ddb","time":{"1.0.0-alpha.0":"2021-09-03T00:10:41.771Z","created":"2021-12-04T16:09:31.221Z","0.1.0":"2021-12-04T16:09:31.376Z","modified":"2022-05-12T23:15:34.843Z"},"name":"pinia-persist","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"pinia-persist","version":"0.1.0","engines":{"node":"^12.13.0 || ^14.15.0"},"description":"Persist and rehydrate your Pinia state between page reloads","main":"dist/index.cjs.prod.js","module":"dist/index.es.prod.js","unpkg":"dist/index.iife.prod.js","jsdelivr":"dist/index.iife.prod.js","types":"dist/index.ts","repository":{"type":"git","url":"git+https://github.com/iendeavor/pinia-persist.git"},"bugs":{"url":"https://github.com/iendeavor/pinia-persist/issues"},"homepage":"https://github.com/iendeavor/pinia-persist#readme","author":{"name":"Ernest","email":"iendeavor.github.io@gmail.com"},"license":"MIT","keywords":["vue","pinia","plugin","persist","rehydrate"],"scripts":{"postinstall":"husky install","prepublishOnly":"pinst --disable","postpublish":"pinst --enable"},"dependencies":{"shvl":"^2.0.3","vue-demi":"latest"},"peerDependencies":{"@vue/composition-api":"^1.1.5","pinia":"^2.0.6","vue":"^2.0.0 || ^3.2"},"peerDependenciesMeta":{"@vue/composition-api":{"optional":true}},"devDependencies":{"@babel/core":"^7.15.5","@babel/preset-env":"^7.15.4","@commitlint/cli":"^13.1.0","@commitlint/config-conventional":"^13.1.0","@rollup/plugin-babel":"^5.3.0","@rollup/plugin-node-resolve":"^13.0.4","@types/jest":"^27","@types/node":"^16.7.5","@vue/test-utils":"^2.0.0-rc.17","change-case":"^4.1.2","husky":"^7.0.2","jest":"^27","pinia":"^2.0.6","pinst":"^2.1.6","prettier":"^2.3.2","rimraf":"^3.0.2","rollup":"^2.56.3","rollup-plugin-replace":"^2.2.0","rollup-plugin-terser":"^7.0.2","rollup-plugin-typescript2":"^0.30.0","standard-version":"^9.3.1","ts-jest":"^27","typescript":"^4.5.2","vue":"^3.2"},"licenseText":"MIT License\n\nCopyright (c) 2021 Ernest\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"pinia-persist@0.1.0","dist":{"shasum":"0a99c329dc30e9e4e47b087f36d58afc8a424702","integrity":"sha512-FRreLF1TuIrZaucOfgulmjaaGvQ8rpygVoeiAwyZ8T5Gssk4qVlA33QcTs06Q7ybY0JztNp7ab85+fcqWA1oSg==","tarball":"https://registry.npmjs.org/pinia-persist/-/pinia-persist-0.1.0.tgz","fileCount":15,"unpackedSize":20231,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhq5K7CRA9TVsSAnZWagAArSAQAIVJRJyXZJ/3X+LpRFFB\nOfLJzVrFnMtxg7BLpEeWcez0hZ8J0rjtm36thlcIN1NDIerG4ug1RW6vNO7l\ndF0c1FTiPAVRb23eUi6bJSjN7B4wpH2Hj3X/kFaVb/hm2EhsK4uozDnpYo44\nIc7XrsposTU+vw5IG0u0zKc4ayyYwaeYWhfn2W+fhvn8NMlg667CkYbQrYfC\nyjwE4GFXzaFwkdxe7FXH7oLU8IQrK0wgYEjq+rlkFSAbM6SEUr3kzcecv8ns\ntrXqVJ8nSfTTTqBYATvfTDkJs1zCxm82YpnXgK0lKiQEv4wA4kfNLh3qHqQF\nDNMcXXTSoERiNuR01W09YLDAxjyOH+Dx2zG8ZTwr6nk6Rhc7MSBFvkQGRII7\nrHuRHX9lWR/bTwrzvlUlD7lQ02ocxuYnRNoxSzZVUv5u8gtC5V7udN14z9P/\njlrr5ytMxdAEjkm6yxpIs3DTAgsfFsOA6j+KIlLioSMCxTED7+7j5Dc/rTBx\n/Fzv1gBApuHx/t8pov97JZl62QOXhMFtiEqDBh4c6ra4ITMKtElyrHh+LBI3\n5N4vRS4u82uSL28/cqF1aoopHyVvj8xhokdeLQmk+BCHStnHReq4RWQo4r99\nztyaEpNL7sWzZrlA7KOAKTsr61ksJMQkpZeqo6j/kkeUOKP3nttP6E1JjqTO\nhjcb\r\n=DBBs\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBTBLbU5AspWJQ4m5ZIofhoFtc/59z8yOsmsukxFjdZkAiEA6gFrHd0BHSLraYiibtlJ2fdxS+5LGhamk+EdfCfquwY="}]},"_npmUser":{"name":"iendeavor","email":"iendeavor.github.io@gmail.com"},"directories":{},"maintainers":[{"name":"iendeavor","email":"iendeavor.github.io@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/pinia-persist_0.1.0_1638634171222_0.01526899372584345"},"_hasShrinkwrap":false}},"maintainers":[{"name":"iendeavor","email":"iendeavor.github.io@gmail.com"}],"description":"Persist and rehydrate your Pinia state between page reloads","homepage":"https://github.com/iendeavor/pinia-persist#readme","keywords":["vue","pinia","plugin","persist","rehydrate"],"repository":{"type":"git","url":"git+https://github.com/iendeavor/pinia-persist.git"},"author":{"name":"Ernest","email":"iendeavor.github.io@gmail.com"},"bugs":{"url":"https://github.com/iendeavor/pinia-persist/issues"},"license":"MIT","readme":"# pinia-persist\n\n> This package works for Vue 2 & 3 by the power of [Vue Demi](https://github.com/vueuse/vue-demi)!\n\n## Getting Started\n\n### Installation\n\n#### NPM\n\n```shell\n$ npm i pinia-persist # yarn add pinia-persist\n```\n\n#### CDN\n\n```html\n<script src=\"https://unpkg.com/pinia-persist\"></script>\n```\n\n### Usage\n\n```ts\nimport { ref } from 'vue' // import { ref } from '@vue/composition-api'\nimport { createPinia, defineStore } from 'pinia'\nimport { createPersistPlugin } from 'pinia-persist'\n\nconst pinia = createPinia()\npinia.use(createPersistPlugin())\n\nconst useCounterStore = defineStore(\n  'counter-store',\n  () => {\n    return {\n      count: ref(0),\n    }\n  },\n  { persist: { storage: window.localStorage } },\n)\n// const counterStore = defineStore('counter-store', {\n//   state() {\n//     return { count: 0 }\n//   },\n//   persist: { storage: window.localStorage },\n// })\n\nconst counterStore = useCounterStore()\ncounterStore.count++ // fires window.localStorage.setItem('counter-store', JSON.stringify({ count: 0 }))\n```\n\n## Contributing\n\nPlease read [CONTRIBUTING.md](/CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull\nrequests to us.\n\n## Versioning\n\nThis project use [SemVer](https://semver.org/) for versioning. For the versions available, see the tags on this repository.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](/LICENSE) file for details\n","readmeFilename":"README.md"}