{"_id":"@codeimplants/app-network","_rev":"7-d28240eca6b02773907519bdeaf45637","name":"@codeimplants/app-network","dist-tags":{"latest":"1.0.6"},"versions":{"1.0.0":{"name":"@codeimplants/app-network","version":"1.0.0","author":{"name":"Antigravity"},"license":"MIT","_id":"@codeimplants/app-network@1.0.0","maintainers":[{"name":"codeimplants","email":"codeimplants@gmail.com"}],"homepage":"https://github.com/user/app-network#readme","bugs":{"url":"https://github.com/user/app-network/issues"},"dist":{"shasum":"55becbbc5ae26e4b1ac26715dd18387ce1971b27","tarball":"https://registry.npmjs.org/@codeimplants/app-network/-/app-network-1.0.0.tgz","fileCount":61,"integrity":"sha512-hlyzfnf0hWcb9lBxT5DGtvEjTKl+kr3K+dx3I6iHFPc9IZ6eev/taLfwGudLG80w27BEeBEo7qmDterBI5lbLA==","signatures":[{"sig":"MEYCIQCmAHGp+nJ18wtTiMf2nIUyqrtDrpK5mzgPx73vxuZTygIhAJmM7JBtxBzf4IaGh2E7crqjluurBT5XSeWXnCjbXgyi","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":45178},"main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"}},"scripts":{"test":"vitest run","build":"tsc && mkdir -p dist/ui && cp src/ui/style.css dist/ui/style.css","test:watch":"vitest","prepublishOnly":"npm run build && npm test"},"_npmUser":{"name":"codeimplants","email":"codeimplants@gmail.com"},"repository":{"url":"git+https://github.com/user/app-network.git","type":"git"},"_npmVersion":"10.9.2","description":"Cross-platform network connectivity monitoring and resilient API client for Web and React Native.","directories":{},"_nodeVersion":"22.16.0","dependencies":{"axios":"^1.13.4"},"_hasShrinkwrap":false,"devDependencies":{"jsdom":"^27.4.0","react":"^19.0.0","vitest":"^4.0.18","typescript":"^5.9.3","@types/node":"^25.0.10","@types/react":"^19.2.10","react-native":"^0.72.0","@types/react-dom":"^19.2.3","@types/react-native":"^0.72.8","@vitejs/plugin-react":"^5.1.2","@testing-library/react":"^16.3.2","@testing-library/jest-dom":"^6.9.1","@react-native-community/netinfo":"^11.4.1"},"peerDependencies":{"react":">=16.8.0","react-native":">=0.60.0","@react-native-community/netinfo":">=5.0.0"},"peerDependenciesMeta":{"react-native":{"optional":true},"@react-native-community/netinfo":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/app-network_1.0.0_1769625531964_0.6398403920146563","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@codeimplants/app-network","version":"1.0.1","author":{"name":"@codeimplants"},"license":"MIT","_id":"@codeimplants/app-network@1.0.1","maintainers":[{"name":"codeimplants","email":"codeimplants@gmail.com"}],"homepage":"https://github.com/user/app-network#readme","bugs":{"url":"https://github.com/user/app-network/issues"},"dist":{"shasum":"cd379432a6b7da10eb5fd94b4c09c3354270d89e","tarball":"https://registry.npmjs.org/@codeimplants/app-network/-/app-network-1.0.1.tgz","fileCount":82,"integrity":"sha512-9RKZI9tBiprbnkuhgP5XJx2hYvju4M6my9pJ9VAtAy/1Lwp4kOZXoiwQCKRvnJtF3Ypss/PcRGuai9ecJjKrLg==","signatures":[{"sig":"MEYCIQD2B28gBAPoy6XkZli0sbA4OHNJT+Ax3sfngKmRJfArFAIhAJV4bDJgVVlQraX6Rn/PSqYda0ZwxaoDoOf2OJjuIY9q","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":95312},"main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"}},"gitHead":"92a55f28f2a100255979e58989f786aead3d5c67","scripts":{"test":"vitest run","build":"tsc && mkdir -p dist/ui && cp src/ui/style.css dist/ui/style.css","test:watch":"vitest","prepublishOnly":"npm run build && npm test"},"_npmUser":{"name":"codeimplants","email":"codeimplants@gmail.com"},"repository":{"url":"git+https://github.com/user/app-network.git","type":"git"},"_npmVersion":"10.9.2","description":"Cross-platform network connectivity monitoring and resilient API client for Web and React Native.","directories":{},"_nodeVersion":"22.16.0","dependencies":{"axios":"^1.13.4"},"_hasShrinkwrap":false,"devDependencies":{"jsdom":"^27.4.0","react":"^19.0.0","vitest":"^4.0.18","react-dom":"^19.2.4","typescript":"^5.9.3","@types/node":"^25.0.10","@types/react":"^19.2.10","react-native":"^0.72.0","@types/react-dom":"^19.2.3","@types/react-native":"^0.72.8","@testing-library/dom":"^10.4.1","@vitejs/plugin-react":"^5.1.2","@testing-library/react":"^16.3.2","@testing-library/jest-dom":"^6.9.1","@react-native-community/netinfo":"^11.4.1"},"peerDependencies":{"react":">=16.8.0","react-native":">=0.60.0","@react-native-community/netinfo":">=5.0.0"},"peerDependenciesMeta":{"react-native":{"optional":true},"@react-native-community/netinfo":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/app-network_1.0.1_1770835808977_0.008421727854752925","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@codeimplants/app-network","version":"1.0.2","author":{"name":"@codeimplants"},"license":"MIT","_id":"@codeimplants/app-network@1.0.2","maintainers":[{"name":"codeimplants","email":"codeimplants@gmail.com"}],"homepage":"https://github.com/user/app-network#readme","bugs":{"url":"https://github.com/user/app-network/issues"},"dist":{"shasum":"58bc1b65011ee8eab265450991fd227a943e3094","tarball":"https://registry.npmjs.org/@codeimplants/app-network/-/app-network-1.0.2.tgz","fileCount":82,"integrity":"sha512-hrI61tEQ3LURqJvziFd/3VIs6+rUWlyjIsXH7bz8xf5A5vBxaah7IPE6kkjNl5nZoprspwOZMuG7SzaNA7W2Qw==","signatures":[{"sig":"MEQCIAFR79HAxJKUZuvnUzNUwihW1Z+sDOQx+kLMlNpgUUmdAiBTPRwwrf1eVmJfr5bnqRsOcbTHfHFrlZhSYhWCqKHQ+A==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":104017},"main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"}},"gitHead":"2b23e44a994d948f66712c66c03bb63e8135c636","scripts":{"test":"vitest run","build":"tsc && mkdir -p dist/ui && cp src/ui/style.css dist/ui/style.css","test:watch":"vitest","prepublishOnly":"npm run build && npm test"},"_npmUser":{"name":"codeimplants","email":"codeimplants@gmail.com"},"repository":{"url":"git+https://github.com/user/app-network.git","type":"git"},"_npmVersion":"10.9.2","description":"Cross-platform network connectivity monitoring and resilient API client for Web and React Native.","directories":{},"_nodeVersion":"22.16.0","dependencies":{"axios":"^1.13.4"},"_hasShrinkwrap":false,"devDependencies":{"jsdom":"^27.4.0","react":"^19.0.0","vitest":"^4.0.18","react-dom":"^19.2.4","typescript":"^5.9.3","@types/node":"^25.0.10","@types/react":"^19.2.10","react-native":"^0.72.0","@types/react-dom":"^19.2.3","@types/react-native":"^0.72.8","@testing-library/dom":"^10.4.1","@vitejs/plugin-react":"^5.1.2","@testing-library/react":"^16.3.2","@testing-library/jest-dom":"^6.9.1","@react-native-community/netinfo":"^11.4.1"},"peerDependencies":{"react":">=16.8.0","react-native":">=0.60.0","@react-native-community/netinfo":">=5.0.0"},"peerDependenciesMeta":{"react-native":{"optional":true},"@react-native-community/netinfo":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/app-network_1.0.2_1770842869925_0.7049784329056057","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"@codeimplants/app-network","version":"1.0.3","author":{"name":"@codeimplants"},"license":"MIT","_id":"@codeimplants/app-network@1.0.3","maintainers":[{"name":"codeimplants","email":"codeimplants@gmail.com"}],"homepage":"https://github.com/user/app-network#readme","bugs":{"url":"https://github.com/user/app-network/issues"},"dist":{"shasum":"c6a862c245c327ec5b5b1647f695c222f08fb8b9","tarball":"https://registry.npmjs.org/@codeimplants/app-network/-/app-network-1.0.3.tgz","fileCount":62,"integrity":"sha512-rO06ER1botA5R4BFF2UaT2I7zVmGHeuXU9b27cL3rcA8m1qJgFvU6QwK43tF5oUj21hPYKu8iX7yhB04KHRcTQ==","signatures":[{"sig":"MEUCIHi64xvey3j6lkgfnfL9V8uVoh57XiS56FUF8gWl4siAAiEA9D4kjb1iYQqMpzuHQoWpTw98dcegWUK9ayHVgwfjm34=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":55242},"main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"}},"gitHead":"648bf607f52586d9d728c25329c3a34155f6daad","scripts":{"test":"vitest run","build":"tsc","test:watch":"vitest","prepublishOnly":"npm run build && npm test"},"_npmUser":{"name":"codeimplants","email":"codeimplants@gmail.com"},"repository":{"url":"git+https://github.com/user/app-network.git","type":"git"},"_npmVersion":"10.9.2","description":"Cross-platform network connectivity monitoring and resilient API client for Web and React Native.","directories":{},"_nodeVersion":"22.16.0","dependencies":{"axios":"^1.13.4"},"_hasShrinkwrap":false,"devDependencies":{"jsdom":"^27.4.0","react":"^19.0.0","vitest":"^4.0.18","react-dom":"^19.2.4","typescript":"^5.9.3","@types/node":"^25.0.10","@types/react":"^19.2.10","react-native":"^0.72.0","@types/react-dom":"^19.2.3","@types/react-native":"^0.72.8","@testing-library/dom":"^10.4.1","@vitejs/plugin-react":"^5.1.2","@testing-library/react":"^16.3.2","@testing-library/jest-dom":"^6.9.1","@react-native-community/netinfo":"^11.4.1"},"peerDependencies":{"react":">=16.8.0","react-native":">=0.60.0","@react-native-community/netinfo":">=5.0.0"},"peerDependenciesMeta":{"react-native":{"optional":true},"@react-native-community/netinfo":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/app-network_1.0.3_1771528048415_0.6666214770288859","host":"s3://npm-registry-packages-npm-production"}},"1.0.4":{"name":"@codeimplants/app-network","version":"1.0.4","author":{"name":"@codeimplants"},"license":"MIT","_id":"@codeimplants/app-network@1.0.4","maintainers":[{"name":"codeimplants","email":"codeimplants@gmail.com"}],"homepage":"https://github.com/user/app-network#readme","bugs":{"url":"https://github.com/user/app-network/issues"},"dist":{"shasum":"a07b9818f256b0d49e1ea5b2414998aee5af5128","tarball":"https://registry.npmjs.org/@codeimplants/app-network/-/app-network-1.0.4.tgz","fileCount":81,"integrity":"sha512-fwxDMhEeBQog3YJ4NCmOeeE4c0/5RyqCvqLKAKYjHcX+lJOZQuL3Jkgm+HnHY7HI9o2m4YdSiZRIFOSqmcMTAg==","signatures":[{"sig":"MEYCIQCOT4WS9OtWQlQEIrlidGbUNvTEE/qpB86brRSso1yh0wIhAM9OmDgHMnkuTb9EHRFsYUioxAgWiWGj4y8prrZ64Qwa","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":89356},"main":"./dist/index.js","types":"./dist/index.d.ts","gitHead":"648bf607f52586d9d728c25329c3a34155f6daad","scripts":{"test":"vitest run","build":"tsc","test:watch":"vitest","prepublishOnly":"npm run build && npm test"},"_npmUser":{"name":"codeimplants","email":"codeimplants@gmail.com"},"repository":{"url":"git+https://github.com/user/app-network.git","type":"git"},"_npmVersion":"11.6.2","description":"Cross-platform network connectivity monitoring and resilient API client for Web and React Native.","directories":{},"_nodeVersion":"22.12.0","dependencies":{"axios":"^1.13.4"},"_hasShrinkwrap":false,"devDependencies":{"jsdom":"^27.4.0","react":"^19.0.0","vitest":"^4.0.18","react-dom":"^19.2.4","typescript":"^5.9.3","@types/node":"^25.0.10","@types/react":"^19.2.10","react-native":"^0.72.0","@types/react-dom":"^19.2.3","@types/react-native":"^0.72.8","@testing-library/dom":"^10.4.1","@vitejs/plugin-react":"^5.1.2","@testing-library/react":"^16.3.2","@testing-library/jest-dom":"^6.9.1","@react-native-community/netinfo":"^11.4.1"},"peerDependencies":{"react":">=16.8.0","react-native":">=0.60.0","@react-native-community/netinfo":">=5.0.0"},"peerDependenciesMeta":{"react-native":{"optional":true},"@react-native-community/netinfo":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/app-network_1.0.4_1771574473514_0.08812022542655651","host":"s3://npm-registry-packages-npm-production"}},"1.0.5":{"name":"@codeimplants/app-network","version":"1.0.5","author":{"name":"@codeimplants"},"license":"MIT","_id":"@codeimplants/app-network@1.0.5","maintainers":[{"name":"codeimplants","email":"codeimplants@gmail.com"}],"homepage":"https://github.com/user/app-network#readme","bugs":{"url":"https://github.com/user/app-network/issues"},"dist":{"shasum":"0e59d3320ee34c7e27eabd0530ccde68231fd793","tarball":"https://registry.npmjs.org/@codeimplants/app-network/-/app-network-1.0.5.tgz","fileCount":62,"integrity":"sha512-QefueZzQPrl6S1UpFOWok/JZUYinowpt2rYXtIkQoqL4BcV2jA9der94ZvNMHnS+ew32tJbughTS/45hJw02Tw==","signatures":[{"sig":"MEYCIQDMKmG8pGXb19cFHvJLbH4JNIJhClFGAWf429LYy9bBIwIhAPAAU546YPNrgRuGqRV4Ze9RLFwi2vqJor9/KpgkRlO0","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":56798},"main":"./dist/index.js","types":"./dist/index.d.ts","gitHead":"35054cb110bdcc8a7f11bffa6cacbac71dbc68f8","scripts":{"test":"vitest run","build":"tsc","test:watch":"vitest","prepublishOnly":"npm run build && npm test"},"_npmUser":{"name":"codeimplants","email":"codeimplants@gmail.com"},"repository":{"url":"git+https://github.com/user/app-network.git","type":"git"},"_npmVersion":"11.6.2","description":"Cross-platform network connectivity monitoring and resilient API client for Web and React Native.","directories":{},"_nodeVersion":"22.12.0","dependencies":{"axios":"^1.13.4"},"_hasShrinkwrap":false,"devDependencies":{"jsdom":"^27.4.0","react":"^19.0.0","vitest":"^4.0.18","react-dom":"^19.2.4","typescript":"^5.9.3","@types/node":"^25.0.10","@types/react":"^19.2.10","react-native":"^0.72.0","@types/react-dom":"^19.2.3","@types/react-native":"^0.72.8","@testing-library/dom":"^10.4.1","@vitejs/plugin-react":"^5.1.2","@testing-library/react":"^16.3.2","@testing-library/jest-dom":"^6.9.1","@react-native-community/netinfo":"^11.4.1"},"peerDependencies":{"react":">=16.8.0","react-native":">=0.60.0","@react-native-community/netinfo":">=5.0.0"},"peerDependenciesMeta":{"react-native":{"optional":true},"@react-native-community/netinfo":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/app-network_1.0.5_1771576280133_0.358223574511062","host":"s3://npm-registry-packages-npm-production"}},"1.0.6":{"name":"@codeimplants/app-network","version":"1.0.6","main":"./dist/index.js","types":"./dist/index.d.ts","description":"Cross-platform network connectivity monitoring and resilient API client for Web and React Native.","author":{"name":"@codeimplants"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/user/app-network.git"},"bugs":{"url":"https://github.com/user/app-network/issues"},"homepage":"https://github.com/user/app-network#readme","scripts":{"build":"tsc","test":"vitest run","test:watch":"vitest","prepublishOnly":"npm run build && npm test"},"dependencies":{"axios":"^1.13.4"},"peerDependencies":{"@react-native-community/netinfo":">=5.0.0","react":">=16.8.0","react-native":">=0.60.0"},"peerDependenciesMeta":{"react-native":{"optional":true},"@react-native-community/netinfo":{"optional":true}},"devDependencies":{"@react-native-community/netinfo":"^11.4.1","@testing-library/dom":"^10.4.1","@testing-library/jest-dom":"^6.9.1","@testing-library/react":"^16.3.2","@types/node":"^25.0.10","@types/react":"^19.2.10","@types/react-dom":"^19.2.3","@types/react-native":"^0.72.8","@vitejs/plugin-react":"^5.1.2","jsdom":"^27.4.0","react":"^19.0.0","react-dom":"^19.2.4","react-native":"^0.72.0","typescript":"^5.9.3","vitest":"^4.0.18"},"_id":"@codeimplants/app-network@1.0.6","gitHead":"6c5b39435b54b98829e1cf3bed2de1ea106a5701","_nodeVersion":"22.16.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-3RrcbqXxRoIYvu0bLWhl0BNbZJ7RmIkwQv2vATYcEXgrHHf2iZhDdYL+nghMkZobWh3cK2WiZaANUbi5hrYZnw==","shasum":"03fdfc0d4c8f910d2a2263d77327b4f04f447deb","tarball":"https://registry.npmjs.org/@codeimplants/app-network/-/app-network-1.0.6.tgz","fileCount":62,"unpackedSize":74182,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIEtDaUeTVP86Er9tNrBbS5p3XO9LrYd+YUfULVLjibh1AiBBMEZIXKxXYotMUPZGlwb7uuus+YFzBuwu1Xf0ybLdYQ=="}]},"_npmUser":{"name":"codeimplants","email":"codeimplants@gmail.com"},"directories":{},"maintainers":[{"name":"codeimplants","email":"codeimplants@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/app-network_1.0.6_1771621698931_0.893672505921657"},"_hasShrinkwrap":false}},"time":{"created":"2026-01-28T18:38:51.833Z","modified":"2026-02-20T21:08:19.195Z","1.0.0":"2026-01-28T18:38:52.103Z","1.0.1":"2026-02-11T18:50:09.117Z","1.0.2":"2026-02-11T20:47:50.055Z","1.0.3":"2026-02-19T19:07:28.584Z","1.0.4":"2026-02-20T08:01:13.685Z","1.0.5":"2026-02-20T08:31:20.288Z","1.0.6":"2026-02-20T21:08:19.075Z"},"bugs":{"url":"https://github.com/user/app-network/issues"},"author":{"name":"@codeimplants"},"license":"MIT","homepage":"https://github.com/user/app-network#readme","repository":{"type":"git","url":"git+https://github.com/user/app-network.git"},"description":"Cross-platform network connectivity monitoring and resilient API client for Web and React Native.","maintainers":[{"name":"codeimplants","email":"codeimplants@gmail.com"}],"readme":"# @codeimplants/app-network\n\nA lightweight, enterprise-grade network connectivity and instability detection package for React and React Native applications. \nThis package provides pure state management without imposing any UI, allowing full customization.\n\n## Features\n\n- 🔌 **Universal Connectivity**: Works on Web and React Native.\n- 📉 **Instability Detection**: Detects slow or unstable connections (high latency).\n- 🔄 **Real-time Updates**: React hooks for consuming network state.\n- ⚡ **Lightweight**: Minimal dependencies, focused purely on logic.\n\n## Installation\n\n```bash\nnpm install @codeimplants/app-network\n```\n\n## Usage\n\n### 1. Wrap your application with `NetworkProvider`\n\n```tsx\n// App.tsx\nimport { NetworkProvider } from '@codeimplants/app-network';\n\nfunction App() {\n  return (\n    <NetworkProvider \n      instabilityConfig={{\n        pingInterval: 5000,\n        threshold: 1500, // ms\n      }}\n    >\n      <YourApp />\n    </NetworkProvider>\n  );\n}\n```\n\n### 2. Use `useNetwork` hook\n\nAccess the connectivity state anywhere in your app.\n\n```tsx\nimport { useNetwork } from '@codeimplants/app-network';\n\nconst StatusIndicator = () => {\n  const { isOnline, isUnstable, latency } = useNetwork();\n\n  if (!isOnline) return <div>No Internet Connection</div>;\n  \n  if (isUnstable) return <div>Connection Unstable (Latency: {latency}ms)</div>;\n\n  return <div>Online</div>;\n};\n```\n\n### 3. Use `useNetworkInstability` (Standalone)\n\nIf you don't want to use the provider, you can use the hook directly.\n\n```tsx\nimport { useNetworkInstability } from '@codeimplants/app-network';\n\nconst MyComponent = () => {\n    const { isUnstable, latency } = useNetworkInstability();\n    // ...\n}\n```\n\n## API\n\n### `NetworkProvider` Props\n\n| Prop | Type | Description |\n|Args|Type|Description|\n|---|---|---|\n| `children` | `ReactNode` | Your application components. |\n| `instabilityConfig` | `object` | Configuration for instability detection. |\n| `instabilityConfig.pingInterval` | `number` | Interval in ms to check latency (default: 5000). |\n| `instabilityConfig.threshold` | `number` | Latency threshold in ms to consider connection unstable (default: 1500). |\n| `instabilityConfig.checkUrl` | `string` | URL to ping for latency checks (default: Google's generate_204). |\n\n### `useNetwork` Return Value\n\n| Property | Type | Description |\n|---|---|---|\n| `isOnline` | `boolean` | `true` if connected to the internet. |\n| `isUnstable` | `boolean` | `true` if high latency is detected. |\n| `latency` | `number \\| null` | Current estimated latency in ms. |\n| `lastOnlineAt` | `number \\| null` | Timestamp when the device was last online. |\n| `isCheckingInstability` | `boolean` | `true` when a ping check is in progress. |\n\n## License\n\nMIT\n","readmeFilename":"README.md"}