{"_id":"@drupalhunter/unstorage-pinia-plugin","_rev":"1-181fcf22e14a15f84ce665fd3cf00cd1","name":"@drupalhunter/unstorage-pinia-plugin","dist-tags":{"latest":"1.0.3"},"versions":{"1.0.2":{"name":"@drupalhunter/unstorage-pinia-plugin","version":"1.0.2","description":"Pinia store persistence and hydration using unstorage","keywords":["Pinia","unstorage","Vue"],"repository":{"type":"git","url":"git+https://github.com/hunteryun/unstorage-pinia-plugin.git"},"license":"MIT","author":{"name":"hunteryun"},"main":"dist/index.cjs","module":"dist/index.mjs","types":"dist/index.d.ts","scripts":{"build":"vite build","clean":"rimraf dist","lint":"eslint . --ext .ts --fix && sort-package-json","prepack":"npm run clean && npm run build","watch":"vite build --watch"},"devDependencies":{"@typescript-eslint/eslint-plugin":"^5.55.0","@typescript-eslint/parser":"^5.55.0","esbuild":"^0.17.11","eslint":"^8.36.0","pinia":"^2.0.33","rimraf":"^4.4.0","sort-package-json":"^2.4.1","typescript":"^4.9.5","unstorage":"^1.4.0","vite":"^4.1.4","vite-plugin-dts":"^2.1.0"},"peerDependencies":{"pinia":"^2.0.33","unstorage":"^1.4.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"gitHead":"f2802545d9831df5e5ee528ebdc94b32d25c39a7","bugs":{"url":"https://github.com/hunteryun/unstorage-pinia-plugin/issues"},"homepage":"https://github.com/hunteryun/unstorage-pinia-plugin#readme","_id":"@drupalhunter/unstorage-pinia-plugin@1.0.2","_nodeVersion":"18.15.0","_npmVersion":"8.15.0","dist":{"integrity":"sha512-+DdM4o+Eb++B0PolGwhlayK/TspBGM4oBEKQ/ePZP8J+fhFtCci4yE1n5UHtTtOkLTonmbLGQqFjJX9G3M1njQ==","shasum":"febd5778ae9a29da5ecf8a20819c4b739439de27","tarball":"https://registry.npmjs.org/@drupalhunter/unstorage-pinia-plugin/-/unstorage-pinia-plugin-1.0.2.tgz","fileCount":13,"unpackedSize":15080,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGu37dOUU+sUe7q++R04hFDiPErM9YgXC+I5eycWsOlDAiBnNWnfj+QSS+tQ76YVEiLRxSgImN5tKjCt6WNb8ktCSQ=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkD8dQACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmohhw//Y9jJCk9+lYcdTgrICyhWkb7snpbYQRk0bn/GXVV4HmZXwX8Y\r\nT/7Ujt25qT/MLL4r+iU0nb2zAY63kLCEjwmxl8cx8LOle5BQ6ngnHXEQ9yJv\r\nRqRZyYNba02exJ0NBaNUx7oAI245jfNIO18xTP0T+I1IuYC5iMKC+aRx0KD8\r\ndzRrxJ6UJw+SFP8xi1C5AzUYT+0PGDn6vMvvu9zNT+oJfyx2jY6+yjR/bOlT\r\npZP8nOSOwf9I3u46zEwO/gTSi52t8kCgXLrBQtjiFpAK6LH56O3lt5vn7Bt0\r\n9+fOiCcUduu0heUn8Ur8p7EiWTJkw/jKyFiJGzKUUtcW0eTprAJmNRsYTokn\r\noXGh66DY4qjaq41YTi+ltL4lAbYPQ15AB8jdvpZIU+WecFzMociJv8eZ1Xmk\r\nZy46/xRrelNqZpo1VsfoFKjbrqaO/aURh5x7+7LWfoOsp4Rg3jvq8VvGmKxv\r\nC7QuUi3cX+ZUTK7ETQsqQmIczRNV65LmmuIYRY01hC4gN5MxBI2K3DOn1jxo\r\ndgssIvg2bocG09kvO6DNdl0Gru1ZKjQGbfA+r/g/tmrlj+0TzzpJaNtSxFVD\r\nvK1Ewqif6fgcsB71mpOLnRa4zD7e9YJuzQcsiV3bvcCnpyBHKS7y30TgmC0c\r\n9qssT9wPmARIClKKc4vgh1tjuCiA0MqxFno=\r\n=qsGE\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"hunteryun","email":"aviggngyv@gmail.com"},"directories":{},"maintainers":[{"name":"hunteryun","email":"aviggngyv@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/unstorage-pinia-plugin_1.0.2_1678755664296_0.19307422802119034"},"_hasShrinkwrap":false},"1.0.3":{"name":"@drupalhunter/unstorage-pinia-plugin","version":"1.0.3","description":"Pinia store persistence and hydration using unstorage","keywords":["Pinia","unstorage","Vue"],"repository":{"type":"git","url":"git+https://github.com/hunteryun/unstorage-pinia-plugin.git"},"license":"MIT","author":{"name":"hunteryun"},"main":"dist/index.cjs","module":"dist/index.mjs","types":"dist/index.d.ts","scripts":{"build":"vite build","clean":"rimraf dist","lint":"eslint . --ext .ts --fix && sort-package-json","prepack":"npm run clean && npm run build","watch":"vite build --watch"},"devDependencies":{"@typescript-eslint/eslint-plugin":"^5.55.0","@typescript-eslint/parser":"^5.55.0","esbuild":"^0.17.11","eslint":"^8.36.0","pinia":"^2.0.33","rimraf":"^4.4.0","sort-package-json":"^2.4.1","typescript":"^4.9.5","unstorage":"^1.4.0","vite":"^4.1.4","vite-plugin-dts":"^2.1.0"},"peerDependencies":{"pinia":"^2.0.33","unstorage":"^1.4.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"gitHead":"d69b9256a760e0779f019e0743f0e687ab350ec8","bugs":{"url":"https://github.com/hunteryun/unstorage-pinia-plugin/issues"},"homepage":"https://github.com/hunteryun/unstorage-pinia-plugin#readme","_id":"@drupalhunter/unstorage-pinia-plugin@1.0.3","_nodeVersion":"18.15.0","_npmVersion":"8.15.0","dist":{"integrity":"sha512-iEi3U4E7jZF95XxAryGDmpF2Mx03rZFeLV5vk7Rda5rxhbbO1PyY9FQzKRTy4u7UyzZnppRbOSTsStxzbo6+IA==","shasum":"96042840fc2a5d0c7f2a4bf29b7f463563737024","tarball":"https://registry.npmjs.org/@drupalhunter/unstorage-pinia-plugin/-/unstorage-pinia-plugin-1.0.3.tgz","fileCount":13,"unpackedSize":15098,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCoBia/psVpNJf2gzxX3H/TL8m8xTjiJjRdi5iO9jeIwQIgLhrpCEspFQRm6bXpPkEK3yz/cdSAqdEsWm9MluJ4OiY="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkD8y5ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmocNA/+IvP8uwS9mGDGF7+b2BiNc8kgtQLma+Pr6VqOQ9SExEZazTNL\r\nV4KO6Ug24ejgdXTCoR1N5/kL/+C9BHppnwFaaxJ7ZotUPZ2FnQH8qZF5DhXB\r\nh7h+ZykcbuBPxr/+J2kS2w0LSCGwnnZcr5xAqL2lzsnd3J+WQS95QRVpsSCX\r\nCDPYlby81tUWJ4/jqtUyIsMXtRWmBt3i8yBnL4oHsLuAyqw/RGsAbUaHfQAn\r\nmjbaRWFpQnAweiFnPjuNVVaKpdsA3al5JBEh2Z++3ao7yLnDhs/sn0b4OTiZ\r\nx5o6u8lvisnIpzbi/waFYgIYGvLq+o0d3CcwP+seZHy03sMJIcFFIqkgN1OA\r\ndN2uoXymCI4AhgTboVlQHliePs+STi9UfCKkAGYKbgwqVzASJErnlS2qrHJR\r\nXAXX/2JdYPooRH63WxslUPb+PlLQDefJjFLJm39Quuf147WpiBUtOBPZrB6b\r\n5ogrQ2Ih8JSgQY6W+eSJNfaMI+Cls2oXCP2Ke8meWCZwsespnZk74rVEIFXi\r\nC6grb4o6qrGlUzDM7l7L2UEFca9IGZ9r/z+jzI7kEt+PLgC6lM1N/1qr4EPh\r\niHOMSMVG1J5fJPgISfhFhDDcuQOPrzOpFs05Zv8by6lhbYbgFqnMT+l74wNh\r\nMXgRRMNiKwn0+9W/Tr8kjKzlRl+WHBucXBQ=\r\n=eWKi\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"hunteryun","email":"aviggngyv@gmail.com"},"directories":{},"maintainers":[{"name":"hunteryun","email":"aviggngyv@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/unstorage-pinia-plugin_1.0.3_1678757049400_0.5920414422652578"},"_hasShrinkwrap":false}},"time":{"created":"2023-03-14T01:01:04.174Z","1.0.2":"2023-03-14T01:01:04.461Z","modified":"2023-03-14T01:24:09.818Z","1.0.3":"2023-03-14T01:24:09.685Z"},"maintainers":[{"name":"hunteryun","email":"aviggngyv@gmail.com"}],"description":"Pinia store persistence and hydration using unstorage","homepage":"https://github.com/hunteryun/unstorage-pinia-plugin#readme","keywords":["Pinia","unstorage","Vue"],"repository":{"type":"git","url":"git+https://github.com/hunteryun/unstorage-pinia-plugin.git"},"author":{"name":"hunteryun"},"bugs":{"url":"https://github.com/hunteryun/unstorage-pinia-plugin/issues"},"license":"MIT","readme":"# unstorage-pinia-plugin\r\n\r\nPersist and hydrate your pinia state using [unstorage](https://github.com/unjs/unstorage)!\r\n\r\n## Install\r\n```sh\r\n# npm\r\nnpm install unstorage @drupalhunter/unstorage-pinia-plugin\r\n\r\n## Usage\r\nYou can use any available [unstorage driver](https://github.com/unjs/unstorage#drivers). Drivers can be set either globally or per store. Locally defined driver overrides global definition.\r\n\r\nGlobal driver:\r\n```ts\r\n// pinia.ts\r\nimport { createPinia } from 'pinia';\r\nimport { createUnstoragePlugin } from '@drupalhunter/unstorage-pinia-plugin';\r\nimport localStorageDriver from 'unstorage/drivers/localstorage';\r\n\r\nconst pinia = createPinia();\r\n\r\npinia.use(createUnstoragePlugin({\r\n  // unstorage plugin options\r\n}));\r\n\r\nexport default pinia;\r\n```\r\n\r\nPer store driver:\r\n```ts\r\n// pinia.ts\r\nimport { createPinia } from 'pinia';\r\nimport { createUnstoragePlugin } from '@drupalhunter/unstorage-pinia-plugin';\r\n\r\nconst pinia = createPinia();\r\n\r\npinia.use(createUnstoragePlugin());\r\n\r\nexport default pinia;\r\n```\r\n\r\n```ts\r\n// store.ts\r\nimport { computed, ref } from 'vue';\r\nimport { defineStore } from 'pinia';\r\nimport { defineStoreStorage } from '@drupalhunter/unstorage-pinia-plugin';\r\nimport localStorageDriver from 'unstorage/drivers/localstorage';\r\n\r\nexport const useStore = defineStore(\r\n  'store',\r\n  () => {\r\n    // setup and return your state, getters and actions\r\n  },\r\n  {\r\n    unstorage: {\r\n      // unstorage store options\r\n    }\r\n  }\r\n});\r\n```\r\n\r\nIf you prefer the option way:\r\n```ts\r\nimport { defineUnstore } from '@drupalhunter/unstorage-pinia-plugin';\r\nimport localStorageDriver from 'unstorage/drivers/localstorage';\r\n\r\nexport const useStore = defineUnstore(\r\n  'store',\r\n  {\r\n    // define your state, getters and actions\r\n  },\r\n  {\r\n    // unstorage store options\r\n  }\r\n);\r\n```\r\n\r\n## Configuration\r\n\r\n### Plugin options\r\n- `driver: Driver` : Default unstorage driver (see [list](https://github.com/unjs/unstorage#drivers)).\r\n\r\n### Store options\r\n- `driver: Driver` : Driver for the store (see [list](https://github.com/unjs/unstorage#drivers)).\r\n\r\n- `filter?: Array<string>` : State keys you actually want to persist. All keys are pushed by default.\r\n","readmeFilename":"README.md"}