{"name":"@vueuse/core","description":"Collection of essential Vue Composition API","version":"3.0.35","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\">\n<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<a href=\"https://app.netlify.com/\" target=\"__blank\"><img src=\"https://img.shields.io/static/v1?label=deploys%20by&message=netlify&color=00C7B7\" alt=\"Deploys by Netlify\" /></a>\n<a href=\"https://www.npmjs.com/package/@vueuse/core\" target=\"__blank\"><img alt=\"NPM Downloads\" src=\"https://img.shields.io/npm/dm/@vueuse/core?color=35495e\"/></a>\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<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- 🦾 **Type Strong**: Written in Typescript\n- 🕶 **Seamless migration**: Works for **both** Vue 3 and 2\n- 🌎 **Browser compatible**: Use it though CDN\n- 🎪 **Interactive 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 list](#-functions) or [documentations](https://vueuse.js.org/) for more details.\n\n## 📦 Install\n\n### for Vue 3 ([vue-next](https://github.com/vuejs/vue-next)), (Demo: [Vite](https://github.com/antfu/vite-vueuse-starter), [Webpack](https://github.com/antfu/vueuse-next-example))\n\n<pre class='language-bash'>\nnpm i @vueuse/core<b>@vue3</b>\n</pre>\n\n### for Vue 2 with [composition-api](https://github.com/vuejs/composition-api) polyfill\n\n<pre class='language-bash'>\nnpm i @vueuse/core<b>@vue2</b> @vue/composition-api \n</pre>\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 -->\n<script src=\"https://unpkg.com/@vueuse/core@vue3\"></script> \n\n<!-- For Vue 2 -->\n<script src=\"https://unpkg.com/@vueuse/core@vue2\"></script>\n```\n\nIt will be exposed to global as `window.VueUse`\n\n\n## ⚡ Functions\n\nYou can check out 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) — reactive counter increases on every interval\n  - [`useIntervalFn`](https://vueuse.js.org/?path=/story/animation--useintervalfn) — simple wrapper for `setInterval`\n  - [`useNow`](https://vueuse.js.org/?path=/story/animation--usenow) — reactive current timestamp\n  - [`useRaf`](https://vueuse.js.org/?path=/story/animation--useraf) — reactive time elapsed on every `requestAnimationFrame`\n  - [`useRafFn`](https://vueuse.js.org/?path=/story/animation--useraffn) — call function on every `requestAnimationFrame`\n  - [`useTimeout`](https://vueuse.js.org/?path=/story/animation--usetimeout) — update value after a given time\n  - [`useTimeoutFn`](https://vueuse.js.org/?path=/story/animation--usetimeoutfn) — call function after a given time\n  - [`useTransition`](https://vueuse.js.org/?path=/story/animation--usetransition) — transition between values\n\n- Browser\n  - [`useBrowserLocation`](https://vueuse.js.org/?path=/story/browser--usebrowserlocation) — reactive browser location\n  - [`useClipboard`](https://vueuse.js.org/?path=/story/browser--useclipboard) — reactive [Clipboard API](https://developer.mozilla.org/en-US/docs/Web/API/Clipboard_API)\n  - [`useCssVar`](https://vueuse.js.org/?path=/story/browser--usecssvar) — manipulate CSS variables\n  - [`useEventListener`](https://vueuse.js.org/?path=/story/browser--useeventlistener) — use EventListener with ease\n  - [`useFullscreen`](https://vueuse.js.org/?path=/story/browser--usefullscreen) — reactive [Fullscreen API](https://developer.mozilla.org/en-US/docs/Web/API/Fullscreen_API)\n  - [`useMediaQuery`](https://vueuse.js.org/?path=/story/browser--usemediaquery) — reactive [Media Query]((https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries/Testing_media_queries))\n  - [`usePermission`](https://vueuse.js.org/?path=/story/browser--usepermission) — reactive [Permissions API](https://developer.mozilla.org/en-US/docs/Web/API/Permissions_API)\n  - [`usePreferredColorScheme`](https://vueuse.js.org/?path=/story/browser--usepreferredcolorscheme) — reactive [prefers-color-scheme](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme) media query\n  - [`usePreferredDark`](https://vueuse.js.org/?path=/story/browser--usepreferreddark) — reactive dark theme preference\n  - [`usePreferredLanguages`](https://vueuse.js.org/?path=/story/browser--usepreferredlanguages) — reactive [Navigator Languages](https://developer.mozilla.org/en-US/docs/Web/API/NavigatorLanguage/languages)\n  - [`useShare`](https://vueuse.js.org/?path=/story/browser--useshare) — reactive [Web Share API](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/share)\n\n- Misc\n  - [`useWebSocket`](https://vueuse.js.org/?path=/story/misc--usewebsocket) — reactive simple [WebSocket](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/WebSocket) client\n  - [`useWebWorker`](https://vueuse.js.org/?path=/story/misc--usewebworker) — simple [Web Workers](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Using_web_workers) registration and communication\n  - [`useWebWorkerFn`](https://vueuse.js.org/?path=/story/misc--usewebworkerfn) — run expensive function without blocking the UI\n\n- Sensors\n  - [`useBattery`](https://vueuse.js.org/?path=/story/sensors--usebattery) — reactive [Battery Status API](https://developer.mozilla.org/en-US/docs/Web/API/Battery_Status_API)\n  - [`useDeviceLight`](https://vueuse.js.org/?path=/story/sensors--usedevicelight) — reactive [DeviceLightEvent](https://developer.mozilla.org/en-US/docs/Web/API/DeviceLightEvent)\n  - [`useDeviceMotion`](https://vueuse.js.org/?path=/story/sensors--usedevicemotion) — reactive [DeviceMotionEvent](https://developer.mozilla.org/en-US/docs/Web/API/DeviceMotionEvent)\n  - [`useDeviceOrientation`](https://vueuse.js.org/?path=/story/sensors--usedeviceorientation) — reactive [DeviceOrientationEvent](https://developer.mozilla.org/en-US/docs/Web/API/DeviceOrientationEvent)\n  - [`useDocumentVisibility`](https://vueuse.js.org/?path=/story/sensors--usedocumentvisibility) — reactively track [`Document.visibilityState`](https://developer.mozilla.org/en-US/docs/Web/API/Document/visibilityState)\n  - [`useElementVisibility`](https://vueuse.js.org/?path=/story/sensors--useelementvisibility) — tracks the visibility of an element within the viewport\n  - [`useGeolocation`](https://vueuse.js.org/?path=/story/sensors--usegeolocation) — reactive [Geolocation API](https://developer.mozilla.org/en-US/docs/Web/API/Geolocation_API)\n  - [`useMouse`](https://vueuse.js.org/?path=/story/sensors--usemouse) — reactive mouse position\n  - [`useMouseInElement`](https://vueuse.js.org/?path=/story/sensors--usemouseinelement) — reactive mouse position in an element\n  - [`useNetwork`](https://vueuse.js.org/?path=/story/sensors--usenetwork) — reactive [Network status](https://developer.mozilla.org/en-US/docs/Web/API/Network_Information_API)\n  - [`useOnline`](https://vueuse.js.org/?path=/story/sensors--useonline) — reactive online state\n  - [`usePageLeave`](https://vueuse.js.org/?path=/story/sensors--usepageleave) — reactive state to show whether mouse leaves the page\n  - [`useParallax`](https://vueuse.js.org/?path=/story/sensors--useparallax) — create parallax effect easily\n  - [`useWindowScroll`](https://vueuse.js.org/?path=/story/sensors--usewindowscroll) — reactive window scroll\n  - [`useWindowSize`](https://vueuse.js.org/?path=/story/sensors--usewindowsize) — reactive window size\n\n- Side Effects\n  - [`useDebounce`](https://vueuse.js.org/?path=/story/side-effects--usedebounce) — debounce execution of a ref value\n  - [`useDebounceFn`](https://vueuse.js.org/?path=/story/side-effects--usedebouncefn) — debounce execution of a function\n  - [`useThrottle`](https://vueuse.js.org/?path=/story/side-effects--usethrottle) — throttle changing of a ref value\n  - [`useThrottleFn`](https://vueuse.js.org/?path=/story/side-effects--usethrottlefn) — throttle execution of a function\n\n- State\n  - [`createGlobalState`](https://vueuse.js.org/?path=/story/state--createglobalstate) — keep state in global scope to be reused across Vue instances\n  - [`useAsyncState`](https://vueuse.js.org/?path=/story/state--useasyncstate) — reactive async state\n  - [`useCounter`](https://vueuse.js.org/?path=/story/state--usecounter) — basic counter with utility functions\n  - [`useIdle`](https://vueuse.js.org/?path=/story/state--useidle) — tracks whether user is being inactive\n  - [`useLocalStorage`](https://vueuse.js.org/?path=/story/state--uselocalstorage) — reactive [LocalStorage](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage)\n  - [`useSessionStorage`](https://vueuse.js.org/?path=/story/state--usesessionstorage) — reactive [SessionStorage](https://developer.mozilla.org/en-US/docs/Web/API/Window/sessionStorage)\n  - [`useStorage`](https://vueuse.js.org/?path=/story/state--usestorage) — reactive [LocalStorage](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage)/[SessionStorage](https://developer.mozilla.org/en-US/docs/Web/API/Window/sessionStorage)\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) — create a global i18n instance to be reused\n  - [`useI18n`](https://vueuse.js.org/?path=/story/add-ons-i18n--usei18n) — use vue-i18n instance\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) — reactive [Firestore](https://firebase.google.com/docs/firestore) binding\n  - [`useRTDB`](https://vueuse.js.org/?path=/story/add-ons-firebase--usertdb) — reactive [Firebase Realtime Database](https://firebase.google.com/docs/database) binding\n<!--ADDONS_LIST_ENDS-->\n\n## 🔬 Technical Details\n\n### The Versioning\n\nFor every release, it will release two versions of this package. The `3.x.x` is used for Vue 3 and the `2.x.x` is used for Vue 2. We use the major version number to distinguish the different target versions will the minor and patch numbers are shared in both packages.\n\n### Different between 3.x and 2.x\n\nFor 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 the 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## 👨‍🚀 Contributors\n\n### Code Contributors\n\nThis project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)].\n<a href=\"https://github.com/antfu/vueuse/graphs/contributors\"><img src=\"https://opencollective.com/vueuse/contributors.svg?width=890&button=false\" /></a>\n\n### Financial Contributors\n\nBecome a financial contributor and help us sustain our community. [[Contribute](https://opencollective.com/vueuse/contribute)]\n\n#### Individuals\n\n<a href=\"https://opencollective.com/vueuse\"><img src=\"https://opencollective.com/vueuse/individuals.svg?width=890\"></a>\n\n#### Organizations\n\nSupport this project with your organization. Your logo will show up here with a link to your website. [[Contribute](https://opencollective.com/vueuse/contribute)]\n\n<a href=\"https://opencollective.com/vueuse/organization/0/website\"><img src=\"https://opencollective.com/vueuse/organization/0/avatar.svg\"></a>\n<a href=\"https://opencollective.com/vueuse/organization/1/website\"><img src=\"https://opencollective.com/vueuse/organization/1/avatar.svg\"></a>\n<a href=\"https://opencollective.com/vueuse/organization/2/website\"><img src=\"https://opencollective.com/vueuse/organization/2/avatar.svg\"></a>\n<a href=\"https://opencollective.com/vueuse/organization/3/website\"><img src=\"https://opencollective.com/vueuse/organization/3/avatar.svg\"></a>\n<a href=\"https://opencollective.com/vueuse/organization/4/website\"><img src=\"https://opencollective.com/vueuse/organization/4/avatar.svg\"></a>\n<a href=\"https://opencollective.com/vueuse/organization/5/website\"><img src=\"https://opencollective.com/vueuse/organization/5/avatar.svg\"></a>\n<a href=\"https://opencollective.com/vueuse/organization/6/website\"><img src=\"https://opencollective.com/vueuse/organization/6/avatar.svg\"></a>\n<a href=\"https://opencollective.com/vueuse/organization/7/website\"><img src=\"https://opencollective.com/vueuse/organization/7/avatar.svg\"></a>\n<a href=\"https://opencollective.com/vueuse/organization/8/website\"><img src=\"https://opencollective.com/vueuse/organization/8/avatar.svg\"></a>\n<a href=\"https://opencollective.com/vueuse/organization/9/website\"><img src=\"https://opencollective.com/vueuse/organization/9/avatar.svg\"></a>\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.35","_nodeVersion":"12.18.1","_npmVersion":"6.14.5","dist":{"integrity":"sha512-aZe0jtXkn8TuWN9n5FgXA4+ZLwVbRHv8plyT+yJwf0yn/LuLN2U7mIp/OxQP1F44KHa7aGfNKxFXMG1RjPZimw==","shasum":"0d612a4f242b96e355948d41e205afd81c5bcc24","tarball":"http://registry-npm.ywwl.com/@vueuse/core/download/@vueuse/core-3.0.35.tgz","fileCount":8,"unpackedSize":206101,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe/MYxCRA9TVsSAnZWagAAz/UP/R+NbMIYiKYfa7Wbrh8N\nSkXin14nAuwhOEaNE6tCH1Mczgt0zlH99KvIfZwUUPv7MlLRiTZaMeI+mr4y\nsO3S15BYdFHHlSzboKeE8WKNQfBEzPY0NZHmU5OQqOvfVLvgUs7TKiospnQU\nqXC0K3Y+rGz3RwJKR21xV6smBncl1AkSkBf0zRHFEVtSsN9HHTCKR/3cFlb/\nSrZ/HUWOu2FaQ1VnZ2XBsAMASp3r3gUJV60YvkTjdmV9Eyt7Y4D2Uu6gHyil\nCWO1BDlX86swcZPKGzu3gsIw8l8qoiAyYZJiAQlz32GoEteTj7MFg7Mvq+59\nGWiL9p4HCG6usC9ATuQfiTmL+UnrKYr2GRgvA/ryecw7/l6B4CBcHYtFs+9G\n3ISAxGAewACxgyZ0eTrPWC5Y+FcBL8y0Z4Smvd6VAJjs6gLJfMDlyMnx0UQk\n9Hkkrx6j6AgVIt8JV1eoDjoHiFKfKPkXMU31K4cWfmT+IECAJ4y7mvzrENsi\n9JVDCHz1Y/suqwnzAch8sqqqd4/IOBbyiuSQhHqfzOcydOQS6TC0PDOEb9+g\nRF8+NhTQlcdiIcsl4rfKjT+gIMB2n/Xkg2T+xeR4pQJgwR174h62I/2N5+a0\nXdym/DLFRa8m68eJdHYVxCKnIJhHnw4S/GMlUz9b7A1eMwPOD+w1uSKtq3Wo\nMDNO\r\n=N3If\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCs5PppgRhwzQguYekul8bG9mEMNHjTC2cOT6ofmspPegIhAIysGQ+gUb49FHmQirrHYqiKA45kaelwICrfL/kb5R3k"}],"size":47906,"noattachment":false,"key":"/@vueuse/core/-/@vueuse/core-3.0.35.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.35_1593624113429_0.42571919322988827"},"_hasShrinkwrap":false,"publish_time":1593624113553,"_cnpm_publish_time":1593624113553,"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"}}