@net-watch/vue
@net-watch/vue
Vue 3 composable for real online/offline detection and connection quality.
Documentation · Live demo · Source
Built on @net-watch/core: real online/offline detection and connection quality (latency, speed) as a Vue 3 composable.
Install
pnpm add @net-watch/core @net-watch/vue # or npm i / yarn add
Usage
<script setup lang="ts">
import { useNetworkStatus } from '@net-watch/vue'
const status = useNetworkStatus()
</script>
<template>
<span v-if="!status.online">Offline</span>
<span v-else>{{ status.quality }}<template v-if="status.rtt">, {{ status.rtt }} ms</template></span>
</template>
Good to know
-
The default watcher has no
pingUrl, so it detects unplugged cables and Wi-Fi off. Pass your own watcher to also detect "connected but no internet":import { createNetworkWatcher } from '@net-watch/core' export const watcher = createNetworkWatcher({ pingUrl: '/ping' }) -
The state has
online,quality,rtt,downlinkand more. See the state reference.
Learn more
Vue guide · Core package · Source
License
MIT
Related Packages
vue-network-status
A lightweight, reactive network connectivity and offline monitor banner for Vue...
535
0
nihonpost
🗾 Japanese postal code → address lookup for Vue 3. TypeScript-first, zero-confi...
1,157
4
Version History
| Version | Released | Vue | License |
|---|---|---|---|
| 0.2.0 | >=3.3 | MIT | |
| 0.1.1 | >=3.3 | MIT | |
| 0.1.0 | >=3.3 | MIT |
Pre-releases (5)
| Version | Released | Vue | License |
|---|---|---|---|
| 0.2.0-beta-20261019101243 | >=3.3 | MIT | |
| 0.1.1-beta-20261019045643 | >=3.3 | MIT | |
| 0.1.1-beta-20261019045139 | >=3.3 | MIT | |
| 0.1.0-beta.0 | >=3.3 | MIT | |
| 0.0.0-stage |