{"_id":"@cljimenez/json-serializer-vue-localstorage-reactive","name":"@cljimenez/json-serializer-vue-localstorage-reactive","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@cljimenez/json-serializer-vue-localstorage-reactive","version":"1.0.0","description":"Wrapper to use @cljimenez/json-serializer-core and @cljimenez/json-serializer-base-serializer with @cljimenez/vue-localstorage-reactive","main":"./dist/cjs/index.cjs","type":"commonjs","types":"./dist/types/index.d.ts","exports":{".":{"types":"./dist/types/index.d.ts","import":"./dist/esm/index.mjs","require":"./dist/cjs/index.cjs"}},"scripts":{"init:husky":"husky install","documentation:create":"npx readme-md-generator -y","init":"npm run init:husky","format":"prettier --check .","format:fix":"prettier --write .","format:build-stage":"prettier --check src","format:build-stage:fix":"prettier --write src","lint":"eslint --ext .js,.mjs .","lint:fix":"npm run lint -- --fix","lint:build-stage":"eslint --ext .js,.mjs src","lint:build-stage:fix":"npm run lint:build-stage -- --fix","build:clean":"rimraf dist","build:clean-dist-tmp":"rimraf dist/tmp","build:bundle":"rollup --config","build:tsc":"tsc","prebuild":"npm run lint:build-stage && npm run format:build-stage:fix && npm run build:clean","build":"npm run build:tsc && npm run build:bundle && npm run build:clean-dist-tmp","test":"jest --verbose","commitlint":"npx commitlint --edit","lint-staged":"npx lint-staged","prepublishOnly":"npm run build","quality-check":"npm run format && npm run lint && npm run test"},"repository":{"type":"git","url":"git+https://github.com/cristopher1/json-serializer-vue-localstorage-reactive.git"},"keywords":["wrapper","json-serializer","json-serializer-core","json-serializer-base-serializers","vue-localstorage-reactive","local","storage","serialize","unserialize","serializer"],"author":{"name":"Cristopher Jiménez"},"license":"MIT","bugs":{"url":"https://github.com/cristopher1/json-serializer-vue-localstorage-reactive/issues"},"homepage":"https://github.com/cristopher1/json-serializer-vue-localstorage-reactive#readme","dependencies":{"@babel/runtime-corejs3":"^7.22.11","@cljimenez/json-serializer-base-serializers":"^1.0.2","@cljimenez/json-serializer-core":"^1.0.2","core-js":"^3.32.1"},"devDependencies":{"@babel/cli":"^7.22.10","@babel/core":"^7.22.10","@babel/plugin-transform-runtime":"^7.22.10","@babel/preset-env":"^7.22.10","@commitlint/cli":"^17.8.0","@commitlint/config-conventional":"^17.8.0","@faker-js/faker":"^8.0.2","@rollup/plugin-babel":"^6.0.3","@rollup/plugin-node-resolve":"^15.2.0","eslint":"^8.47.0","eslint-config-prettier":"^9.0.0","eslint-config-standard":"^17.1.0","eslint-plugin-import":"^2.28.1","eslint-plugin-jest":"^27.2.3","eslint-plugin-jsdoc":"^46.8.2","eslint-plugin-n":"^16.0.2","eslint-plugin-promise":"^6.1.1","husky":"^8.0.3","jest":"^29.7.0","jest-environment-jsdom":"^29.6.4","lint-staged":"^14.0.1","prettier":"^3.0.2","prettier-plugin-jsdoc":"^1.1.1","readme-md-generator":"^1.0.0","rimraf":"^5.0.1","rollup":"^3.28.0","rollup-plugin-dts":"^6.1.0","typescript":"^5.2.2"},"gitHead":"11a5843af7cad00d645a01f86fb32711a1ea1c3d","_id":"@cljimenez/json-serializer-vue-localstorage-reactive@1.0.0","_nodeVersion":"18.17.0","_npmVersion":"9.6.7","dist":{"integrity":"sha512-1mJtcd82/5VNrKnvsthG6PKMiwyy1xDGVDh/Xl9RIATGMVpvmsz5+UFlKoTzI2CmX7Ma/Cx83hp2stC1vtOdHA==","shasum":"86465bb7ce24d2fddea9512a166b2f759eea7467","tarball":"https://registry.npmjs.org/@cljimenez/json-serializer-vue-localstorage-reactive/-/json-serializer-vue-localstorage-reactive-1.0.0.tgz","fileCount":8,"unpackedSize":31848,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC+QFf4XWCLvtKbvtiFIR+QKFgmLHpW7CKk+y3yT9Oj6AiEA9jJq70wUAbcTadA5zc25ZC4WJTmjq24HuIv2zShUbto="}]},"_npmUser":{"name":"cljimenez","email":"crisjimenezmeza@live.com"},"directories":{},"maintainers":[{"name":"cljimenez","email":"crisjimenezmeza@live.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/json-serializer-vue-localstorage-reactive_1.0.0_1698807477459_0.3752374579203819"},"_hasShrinkwrap":false}},"time":{"created":"2023-11-01T02:57:57.391Z","1.0.0":"2023-11-01T02:57:57.614Z","modified":"2023-11-01T02:57:57.849Z"},"maintainers":[{"name":"cljimenez","email":"crisjimenezmeza@live.com"}],"description":"Wrapper to use @cljimenez/json-serializer-core and @cljimenez/json-serializer-base-serializer with @cljimenez/vue-localstorage-reactive","homepage":"https://github.com/cristopher1/json-serializer-vue-localstorage-reactive#readme","keywords":["wrapper","json-serializer","json-serializer-core","json-serializer-base-serializers","vue-localstorage-reactive","local","storage","serialize","unserialize","serializer"],"repository":{"type":"git","url":"git+https://github.com/cristopher1/json-serializer-vue-localstorage-reactive.git"},"author":{"name":"Cristopher Jiménez"},"bugs":{"url":"https://github.com/cristopher1/json-serializer-vue-localstorage-reactive/issues"},"license":"MIT","readme":"<h1 align=\"center\">Welcome to @cljimenez/json-serializer-vue-localstorage-reactive 👋</h1>\n<p>\n  <img alt=\"Version\" src=\"https://img.shields.io/badge/version-1.0.0-blue.svg?cacheSeconds=2592000\" />\n  <a href=\"https://github.com/cristopher1/json-serializer-vue-localstorage-reactive#readme\" target=\"_blank\">\n    <img alt=\"Documentation\" src=\"https://img.shields.io/badge/documentation-yes-brightgreen.svg\" />\n  </a>\n  <a href=\"https://github.com/cristopher1/json-serializer-vue-localstorage-reactive/graphs/commit-activity\" target=\"_blank\">\n    <img alt=\"Maintenance\" src=\"https://img.shields.io/badge/Maintained%3F-yes-green.svg\" />\n  </a>\n  <a href=\"https://github.com/cristopher1/json-serializer-vue-localstorage-reactive/blob/master/LICENSE\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/github/license/cristopher1/json-serializer-vue-localstorage-reactive\" />\n  </a>\n</p>\n\n> Wrapper to use @cljimenez/json-serializer-core and @cljimenez/json-serializer-base-serializers with @cljimenez/vue-localstorage-reactive\n\n### 🏠 [Homepage](https://github.com/cristopher1/json-serializer-vue-localstorage-reactive#readme)\n\n### [Index](#index)\n\n- [Install](#install)\n- [How to use?](#how-to-use?)\n  - [Obtain the JsonSerializerAdapter object](#obtain-json-serializer-adapter-object)\n  - [About the JsonSerializerAdapter methods](#json-serializer-adapter-interface)\n  - [How to use @cljimenez/json-serializer-vue-localstorage-reactive with @cljimenez/vue-localstorage-reactive](#json-serializer-adapter-with-reactive-local-storage)\n- [Author](#author)\n- [Contributing](#contributing)\n- [License](#license)\n\n## Install\n\n```sh\n@cljimenez/json-serializer-vue-localstorage-reactive\n```\n\n## <a id=\"how-to-use?\"></a> How to use?\n\n- ### <a id=\"obtain-json-serializer-adapter-object\"></a> Obtain the JsonSerializerAdapter object\n\n  The JsonSerializerAdapter is an object used to wrap the @cljimenez/json-serializer-core to be used directly by @cljimenez/vue-localstorage-reactive, also it adds the serializers provided by @cljimenez/json-serializer-base-serializers. You can use this package with @cljimenez/vue-localstorage-reactive or with other elements that requires the parse and serialize methods described in [About the JsonSerializerAdapter methods](#json-serializer-adapter-interface). You must use the `createJsonSerializerAdapter` function to create a JsonSerializerAdapter object.\n\n  Example:\n\n  ```js\n  import { createJsonSerializerAdapter } from '@cljimenez/json-serializer-vue-localstorage-reactive'\n\n  // If you want to use the function serializer.\n  const JsonSerializerAdapterWithFunctionSerializer =\n    createJsonSerializerAdapter({ includeFunctionSerializer: true })\n\n  // If you do not want to use the function serializer\n  const JsonSerializerAdapterWithoutFunctionSerializer =\n    createJsonSerializerAdapter()\n  ```\n\n- ### <a id=\"json-serializer-adapter-interface\"></a> About the JsonSerializerAdapter methods\n\n  The JsonSerializerAdapter object provides the following methods:\n\n  - `(method)` getSerializers(void): Returns an object that contains the serializers added to JsonSerializer object. The keys are obtained from serializer.getSerializerType method and the values are the Serializer objects.\n  - `(method)` installSerializersAndRefreshJsonSerializer(serializersInstaller: SerializerInstaller, installOptions = {}): Adds serializers through the serializersInstaller and to update the JsonSerializer object.\n  - `(method)` addSerializerAndRefreshJsonSerializer(serializer): Adds a Serializer and to update the JsonSerializer object.\n  - `(method)` serialize(value, options = {}): Serializes the data. The optional options parameter contains some configuration used by the serialize algorithm.\n  - `(method)` parse(value, options = {}): Unserializes the data serialized by serialize method. The optional options parameter contains some configuration used by the parse algorithm.\n\n- ### <a id=\"json-serializer-adapter-with-reactive-local-storage\"></a> How to use @cljimenez/json-serializer-vue-localstorage-reactive with @cljimenez/vue-localstorage-reactive\n\n  First you must install [@cljimenez/vue-localstorage-reactive](https://www.npmjs.com/package/@cljimenez/vue-localstorage-reactive) using:\n\n  ```sh\n  npm install @cljimenez/vue-localstorage-reactive\n  ```\n\n  Then, you can use it through the provide and inject functions.\n\n  Example:\n\n  ```js\n  // main.js\n  import { createJsonSerializerAdapter } from '@cljimenez/json-serializer-vue-localstorage-reactive'\n  import { createReactiveLocalStorageInstaller } from '@cljimenez/vue-localstorage-reactive'\n  import { createApp } from 'vue'\n  import App from './App.vue'\n\n  const app = createApp(App)\n\n  const serializer = createJsonSerializerAdapter({ includeFunctionSerializer: true })\n\n  app.use(createReactiveLocalStorageInstaller(), { serializer })\n\n  app.provide('reactiveLocalStorage', app.config.globalProperties.$reactiveLocalStorage)\n\n  app.mount('#app')\n\n  // App.vue\n  <script setup>\n  import { inject } from 'vue';\n\n  const reactiveLocalStorage = inject('reactiveLocalStorage')\n\n  const helloWord = reactiveLocalStorage.getItem('helloWord')\n\n  if (helloWord) {\n    console.log('from localStorage')\n    helloWord()\n  }\n\n  reactiveLocalStorage.setItem('helloWord', () => {\n    console.log('hello word')\n    console.log('using reactiveLocalStorage and jsonSerializerAdapter')\n  })\n\n  </script>\n\n  <template>\n    <h1></h1>\n  </template>\n  ```\n\n## <a id=\"author\"></a> Author\n\n👤 **Cristopher Jiménez**\n\n- Github: [@cristopher1](https://github.com/cristopher1)\n\n## <a id=\"contributing\"></a> 🤝 Contributing\n\nContributions, issues and feature requests are welcome!<br />Feel free to check [issues page](https://github.com/cristopher1/json-serializer-vue-localstorage-reactive/issues).\n\n## <a id=\"license\"></a> 📝 License\n\nCopyright © 2023 [Cristopher Jiménez](https://github.com/cristopher1).<br />\nThis project is [MIT](https://github.com/cristopher1/json-serializer-vue-localstorage-reactive/blob/master/LICENSE) licensed.\n\n---\n\n_This README was generated with ❤️ by [readme-md-generator](https://github.com/kefranabg/readme-md-generator)_\n","readmeFilename":"README.md"}