use-online-checking 1.0.5 → 1.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +26 -17
  2. package/package.json +47 -4
package/README.md CHANGED
@@ -1,6 +1,8 @@
1
- # useOnline
1
+ # use-online-checking
2
2
 
3
- A simple and lightweight custom React hook to detect browser online and offline status in real-time.
3
+ A lightweight React hook to detect internet connection status (online/offline) in real-time.
4
+
5
+ This hook helps React developers easily track browser network status changes.
4
6
 
5
7
  ---
6
8
 
@@ -10,21 +12,22 @@ A simple and lightweight custom React hook to detect browser online and offline
10
12
  - ⚡ Real-time network status detection
11
13
  - 🔄 Automatic event listener cleanup
12
14
  - 🧠 Easy to use in any React project
15
+ - ✅ TypeScript support included
13
16
 
14
17
  ---
15
18
 
16
19
  ## 📦 Installation
17
20
 
18
- If published to npm:
19
-
20
21
  ```bash
21
22
  npm install use-online-checking
22
23
  ```
23
24
 
24
- Or clone the repository:
25
+ ---
25
26
 
26
- ```bash
27
- git clone https://github.com/Prem-Ray/use-online-checking.git
27
+ ## 📥 Import
28
+
29
+ ```js
30
+ import useOnline from "use-online-checking";
28
31
  ```
29
32
 
30
33
  ---
@@ -66,33 +69,39 @@ When the network status changes, the state updates automatically.
66
69
 
67
70
  ## 📌 API
68
71
 
69
- ### `useOnline()`
72
+ ### `useOnline(): boolean`
70
73
 
71
74
  Returns:
72
75
 
73
- | Name | Type | Description |
74
- |-----------|---------|---------------------------------|
75
- | isOnline | boolean | Current internet connection status |
76
+ | Name | Type | Description |
77
+ |----------|---------|--------------------------------------|
78
+ | isOnline | boolean | Current internet connection status |
76
79
 
77
80
  ---
78
81
 
79
- ## 📁 Project Structure
82
+ ## 📁 Package Structure
80
83
 
81
84
  ```
82
- use-online/
85
+ use-online-checking/
83
86
 
84
87
  ├── src/
85
- ├── useOnline.js
86
- │ ├── App.jsx
87
- │ ├── main.jsx
88
+ └── useOnline.js
88
89
 
90
+ ├── index.js
91
+ ├── index.d.ts
89
92
  ├── package.json
90
93
  ├── README.md
91
- └── vite.config.js
94
+ └── LICENSE
92
95
  ```
93
96
 
94
97
  ---
95
98
 
99
+ ## 🛠 Requirements
100
+
101
+ - React 16.8 or higher (Hooks support)
102
+
103
+ ---
104
+
96
105
  ## 🤝 Contributing
97
106
 
98
107
  Contributions are welcome.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "use-online-checking",
3
- "version": "1.0.5",
3
+ "version": "1.0.7",
4
4
  "description": "Lightweight React hook to detect online/offline network status in real time.",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -8,13 +8,56 @@
8
8
  "exports": {
9
9
  ".": "./index.js"
10
10
  },
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "https://github.com/Prem-Ray/use-online-checking.git"
14
+ },
15
+ "bugs": {
16
+ "url": "https://github.com/Prem-Ray/use-online-checking/issues"
17
+ },
18
+ "homepage": "https://github.com/Prem-Ray/use-online-checking#readme",
19
+ "author": "Premanshu Ray",
11
20
  "keywords": [
12
21
  "react",
13
22
  "react-hook",
14
23
  "custom-hook",
15
- "network",
16
- "online",
17
- "offline"
24
+ "useOnline",
25
+ "online-status",
26
+ "offline-detection",
27
+ "internet-connection",
28
+ "network-status",
29
+ "react-online-hook",
30
+ "isOnline",
31
+ "isOffline",
32
+ "checkOffline",
33
+ "checkOnline",
34
+ "checkUserOnline",
35
+ "checkUserOffline",
36
+ "online-status-hook",
37
+ "react use-online",
38
+ "use-online",
39
+ "connection-status",
40
+ "detect-connection",
41
+ "network-connectivity",
42
+ "navigator.onLine",
43
+ "browser-offline",
44
+ "offline-first",
45
+ "pwa",
46
+ "service-worker",
47
+ "connectivity-monitor",
48
+ "js",
49
+ "javascript",
50
+ "typescript",
51
+ "react-hooks",
52
+ "hooks",
53
+ "react-hook-library",
54
+ "lightweight-hook",
55
+ "small-package",
56
+ "is-online-hook",
57
+ "online-offline-detection",
58
+ "detect-offline-react",
59
+ "react-network-status",
60
+ "client-side-network"
18
61
  ],
19
62
  "peerDependencies": {
20
63
  "react": ">=16.8"