{"name":"@vueuse/core","description":"Collection of essential Vue Composition API","version":"3.0.9","main":"index.cjs.js","typings":"index.d.ts","module":"index.esm.js","unpkg":"index.umd.min.js","browser":"index.esm.js","repository":{"type":"git","url":"git+https://github.com/antfu/vueuse.git"},"keywords":["vue","vue-use","utils"],"author":{"name":"Anthony Fu","email":"https://github.com/antfu"},"license":"MIT","bugs":{"url":"https://github.com/antfu/vueuse/issues"},"homepage":"https://github.com/antfu/vueuse#readme","peerDependencies":{"vue":"next"},"readme":"<p align=\"center\">\n<a href=\"https://github.com/antfu/vueuse\"><img src=\"https://raw.githubusercontent.com/antfu/vueuse/master/resources/logo-vertical.png\" alt=\"logo\" width=\"300\"/></a>\n</p>\n\n<p align=\"center\">\n<a href=\"https://www.npmjs.com/package/@vueuse/core\" target=\"__blank\"><img src=\"https://img.shields.io/npm/v/@vueuse/core?color=a1b858\" alt=\"NPM version\" /></a>\n<a href=\"https://vueuse.js.org\" target=\"__blank\"><img src=\"https://img.shields.io/static/v1?label=storybook&message=demos&color=63ba83\" alt=\"Storybook Demos\" /></a>\n<img alt=\"NPM Downloads\" src=\"https://img.shields.io/npm/dm/@vueuse/core?color=35495e\"/>\n<a href=\"https://github.com/antfu/vueuse\" target=\"__blank\"><img src=\"https://img.shields.io/github/last-commit/antfu/vueuse.svg?color=a38eed\" alt=\"GitHub last commit\" /></a>\n<a href=\"https://github.com/antfu/vueuse/issues\" target=\"__blank\"><img src=\"https://img.shields.io/github/issues/antfu/vueuse.svg?color=c977be\" alt=\"GitHub issues\" /></a>\n<a href=\"https://github.com/antfu/vueuse\" target=\"__blank\"><img alt=\"GitHub stars\" src=\"https://img.shields.io/github/stars/antfu/vueuse?style=social\"></a>\n</p>\n\n\n<p align=\"center\">\nCollection of essential Vue Composition API (inspired by <a href='https://github.com/streamich/react-use' target='__blank'>react-use</a>)\n</p>\n\n\n## 🚀 Features\n\n- 0 dependencies ⚡ No worry about your bundle size\n- Fully tree shakable 🌴 Only take what you want\n- Seamless migration 🕶 Works for **both** Vue 3.x and 2.x\n- Browser compatible 🌐 Use it without complex building tools\n- Intractive docs & demos 🎪 [Check out the Storybook!](https://vueuse.js.org)\n- Optional [Add-ons](#-add-ons) 🔌 Firebase, vue-i18n, etc\n\n## 🦄 Usage\n\n```ts\nimport { useMouse, usePreferredDark, useLocalStorage } from '@vueuse/core'\n\nnew Vue({\n  setup() {\n    // tracks mouse position\n    const { x, y } = useMouse()\n\n    // is user prefers dark theme\n    const isDark = usePreferredDark()\n\n    // persist state in localStorage\n    const state = useLocalStorage(\n      'my-storage', \n      {\n        name: 'Apple',\n        color: 'red',\n      },\n    )\n\n    return { x, y, isDark, state }\n  }\n})\n```\n\nRefer to [functions](#-functions) and [documentations](https://vueuse.js.org/) for more details.\n\n## 📦 Install\n\n### for Vue 3.x ([vue-next](https://github.com/vuejs/vue-next)), [*demo here*](https://vueuse-next-example.netlify.com/)\n\n```bash\nnpm i @vueuse/core@vue3\n```\n\n### for Vue 2.x with [composition-api](https://github.com/vuejs/composition-api) polyfill\n\n```bash\nnpm i @vue/composition-api @vueuse/core@vue2\n```\n\nPlease [register the Composition API Plugin](https://github.com/vuejs/composition-api#usage) before using APIs.\n\n### CDN\n\n```html\n<!-- For Vue 3.x -->\n<script src=\"https://unpkg.com/@vueuse/core@vue3\"></script> \n\n<!-- For Vue 2.x -->\n<script src=\"https://unpkg.com/@vueuse/core@vue2\"></script>\n```\n\nIt will be exposed to global variable as `window.VueUse`\n\n\n## ⚡ Functions\n\nYou can checkout the full documents and live demos in [Storybook](https://vueuse.js.org/).\n\n<!--GENEARTED LIST, DO NOT MODIFY MANUALLY-->\n<!--FUNCTIONS_LIST_STARTS-->\n\n- Animation\n  - [`useInterval`](https://vueuse.js.org/?path=/story/animation--useinterval)\n  - [`useIntervalFn`](https://vueuse.js.org/?path=/story/animation--useintervalfn)\n  - [`useNow`](https://vueuse.js.org/?path=/story/animation--usenow)\n  - [`useRaf`](https://vueuse.js.org/?path=/story/animation--useraf)\n  - [`useRafFn`](https://vueuse.js.org/?path=/story/animation--useraffn)\n  - [`useTimeout`](https://vueuse.js.org/?path=/story/animation--usetimeout)\n  - [`useTimeoutFn`](https://vueuse.js.org/?path=/story/animation--usetimeoutfn)\n\n- Browser\n  - [`useBrowserLocation`](https://vueuse.js.org/?path=/story/browser--usebrowserlocation)\n  - [`useClipboard`](https://vueuse.js.org/?path=/story/browser--useclipboard)\n  - [`useCssVar`](https://vueuse.js.org/?path=/story/browser--usecssvar)\n  - [`useEventListener`](https://vueuse.js.org/?path=/story/browser--useeventlistener)\n  - [`useFullscreen`](https://vueuse.js.org/?path=/story/browser--usefullscreen)\n  - [`useMediaQuery`](https://vueuse.js.org/?path=/story/browser--usemediaquery)\n  - [`usePermission`](https://vueuse.js.org/?path=/story/browser--usepermission)\n  - [`usePreferredColorScheme`](https://vueuse.js.org/?path=/story/browser--usepreferredcolorscheme)\n  - [`usePreferredDark`](https://vueuse.js.org/?path=/story/browser--usepreferreddark)\n  - [`usePreferredLanguages`](https://vueuse.js.org/?path=/story/browser--usepreferredlanguages)\n\n- Misc\n  - [`useWebSocket`](https://vueuse.js.org/?path=/story/misc--usewebsocket)\n  - [`useWebWorker`](https://vueuse.js.org/?path=/story/misc--usewebworker)\n\n- Sensors\n  - [`useBattery`](https://vueuse.js.org/?path=/story/sensors--usebattery)\n  - [`useDeviceLight`](https://vueuse.js.org/?path=/story/sensors--usedevicelight)\n  - [`useDeviceMotion`](https://vueuse.js.org/?path=/story/sensors--usedevicemotion)\n  - [`useDeviceOrientation`](https://vueuse.js.org/?path=/story/sensors--usedeviceorientation)\n  - [`useGeolocation`](https://vueuse.js.org/?path=/story/sensors--usegeolocation)\n  - [`useMouse`](https://vueuse.js.org/?path=/story/sensors--usemouse)\n  - [`useMouseInElement`](https://vueuse.js.org/?path=/story/sensors--usemouseinelement)\n  - [`useNetwork`](https://vueuse.js.org/?path=/story/sensors--usenetwork)\n  - [`useOnline`](https://vueuse.js.org/?path=/story/sensors--useonline)\n  - [`usePageLeave`](https://vueuse.js.org/?path=/story/sensors--usepageleave)\n  - [`useParallax`](https://vueuse.js.org/?path=/story/sensors--useparallax)\n  - [`useWindowScroll`](https://vueuse.js.org/?path=/story/sensors--usewindowscroll)\n  - [`useWindowSize`](https://vueuse.js.org/?path=/story/sensors--usewindowsize)\n\n- State\n  - [`createGlobalState`](https://vueuse.js.org/?path=/story/state--createglobalstate)\n  - [`useAsyncState`](https://vueuse.js.org/?path=/story/state--useasyncstate)\n  - [`useCounter`](https://vueuse.js.org/?path=/story/state--usecounter)\n  - [`useIdle`](https://vueuse.js.org/?path=/story/state--useidle)\n  - [`useLocalStorage`](https://vueuse.js.org/?path=/story/state--uselocalstorage)\n  - [`useSessionStorage`](https://vueuse.js.org/?path=/story/state--usesessionstorage)\n  - [`useStorage`](https://vueuse.js.org/?path=/story/state--usestorage)\n  - [`useStoragePlain`](https://vueuse.js.org/?path=/story/state--usestorageplain)\n\n<!--FUNCTIONS_LIST_ENDS-->\n\nMore functions to be added. Please keep turned. (PRs are also welcome!)\n\n## 🔌 Add-ons\n\nThe core package aims to be lightweight and dependence free. While the add-ons are wrapping popular packages into the consistent API style.\n\n<!--GENEARTED LIST, DO NOT MODIFY MANUALLY-->\n<!--ADDONS_LIST_STARTS-->\n- 🌍 i18n ([`@vueuse/i18n`](https://vueuse.js.org/?path=/story/add-ons-i18n--read-me)) - Composition wrapper for [vue-i18n](https://github.com/kazupon/vue-i18n)\n  - [`createI18n`](https://vueuse.js.org/?path=/story/add-ons-i18n--createi18n)\n  - [`useI18n`](https://vueuse.js.org/?path=/story/add-ons-i18n--usei18n)\n\n- 🔥 Firebase ([`@vueuse/firebase`](https://vueuse.js.org/?path=/story/add-ons-firebase--read-me)) - enables realtime bindings for [Firebase](https://firebase.google.com/)\n  - [`useFirestore`](https://vueuse.js.org/?path=/story/add-ons-firebase--usefirestore)\n  - [`useRTDB`](https://vueuse.js.org/?path=/story/add-ons-firebase--usertdb)\n<!--ADDONS_LIST_ENDS-->\n\n## 🔬 Technical Details\n\n### The Versioning\n\nFor every release, it will release two version of this package. The `3.x.x` is used for Vue 3.x and the `2.x.x` is used for 2.x. We use the major version number to distinguish the different target version will the minor and patch numbers are shared in both packages.\n\n### Different between 3.x and 2.x\n\nSince the Composition API will be available in 3.x. Using it in 2.x require you use a polyfill. For 3.x build, we use the API from [`@vue/runtime-dom`](https://www.npmjs.com/package/@vue/runtime-dom), and for 2.x, it's [`@vue/composition-api`](https://www.npmjs.com/package/@vue/composition-api). All the functions exported in this package behaves the same.\n\n```js\n// 3.x build\nimport { ref } from '@vue/runtime-dom'\n\n// 2.x build\nimport { ref } from '@vue/composition-api'\n```\n\n## 🧱 Contribute\n\nSee the [**Contributing Guide**](https://vueuse.js.org/?path=/story/docs--contribute)\n\n## 🌸 Thanks\n\nThis project is heavily inspired by following awesome projects.\n\n- [streamich/react-use](https://github.com/streamich/react-use)\n- [u3u/vue-hooks](https://github.com/u3u/vue-hooks)\n- [shuidi-fed/vue-composition-toolkit](https://github.com/shuidi-fed/vue-composition-toolkit)\n- [logaretm/vue-use-web](https://github.com/logaretm/vue-use-web)\n- [kripod/react-hooks](https://github.com/kripod/react-hooks)\n\nThanks!\n\n\n## 📄 License\n\n[MIT License](https://github.com/antfu/vueuse/blob/master/LICENSE) © 2019-2020 [Anthony Fu](https://github.com/antfu)\n","readmeFilename":"README.md","_id":"@vueuse/core@3.0.9","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-QnFalP8OLdMebGfaAb13076lJ5KZomDUYzM7a+NaIRDnymAip6SvaZiqwT+74M9tUWGrqUqn0DPagBq01udKpw==","shasum":"4ae7b2b52647bd3a9dd85c6262fd6a75e9f680bd","tarball":"http://registry-npm.ywwl.com/@vueuse/core/download/@vueuse/core-3.0.9.tgz","fileCount":8,"unpackedSize":141211,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeE0KmCRA9TVsSAnZWagAAzAcQAJlrXA+yOOMKlPZhD+jt\nnSLDI5CM81qqIHwiMMypPnjx4ufQolgG8RIirI7BCmWT8KiJY/OGOx+ZNtqe\nnoxHPXgzlhqWewPtDA+lnBnw5Go1cq13R8g5URptJ0gnKTVbQ/jXVDwq0/Iq\neZQGGCupWzYkDxJMSmHT3RPb540cDSNDEN6Ip1k8HG/U4lckpe5fTUzmQpQK\n5Npa7FO8chFESaarq1a/2aPaCdPn58Do94+DhcFa8X9KHhoa2mhK1oDUtTAc\nEJIjuOEYSa0Li7Awwwy+MtTN/SjFBGDr5w5fbiUiZD7mZST84RpgpYVRXQ9g\nq0LQ871f4fcFaqFw3VRYrnneLQWJWnWDq5u9yzOpmqIq/oxy6nRP2n9qqcyr\nfasXhCERj2AuM3Z4x4dqOp4BUGHr4NmWbE4BY+SI6IchxnsD0OGcgtMEWA6+\nU9rFNMuIoHO8OcxoRl1uX3NWjvLswCXAMI2GF12fTOjxlCfsFhAJz96V8jke\nLe1wW9sWE9niHO6gtgqFPlzWy6FSrkKOR0bMM2fmu/2EEp7HH3rbb973WDIK\nywYlVu2XZJt6uPXfWW6WCa1OA+LJEASW7pGvTVIgGyGK1hAIBnbVkeBFrbtu\nlqvcqy6WqQVAU2xUW4YlTE86bnS6Kwz++kmO3GTh+4fNbWneus/epOIBFqT3\ngKN0\r\n=fWBs\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCp1ihoRvD1OyTXf4WfC+BIb2XC507zWhdNa/W373vE6gIgThTwjiQvvhapDNodiwArjE16BwvJQWFM/99r24AQvKQ="}],"size":31151,"noattachment":false,"key":"/@vueuse/core/-/@vueuse/core-3.0.9.tgz"},"maintainers":[{"name":"antfu","email":"anthonyfu117@hotmail.com"}],"_npmUser":{"name":"antfu","email":"anthonyfu117@hotmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/core_3.0.9_1578320550435_0.05087236775647441"},"_hasShrinkwrap":false,"publish_time":1578320550681,"_cnpm_publish_time":1578320550681,"dist-tags":{"alpha":"14.0.0-alpha.3","beta":"14.0.0-beta.1","demi":"4.0.0-alpha.0","latest":"15.0.0","vue2":"2.0.35","vue3":"3.0.35"}}