{"id":21833475,"url":"https://github.com/olefirenko/use-network-status","last_synced_at":"2025-06-12T15:04:49.387Z","repository":{"id":57388236,"uuid":"275277460","full_name":"olefirenko/use-network-status","owner":"olefirenko","description":"📡 React Hook to getting and following a browser network online status","archived":false,"fork":false,"pushed_at":"2021-08-18T08:42:24.000Z","size":304,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-14T06:09:17.059Z","etag":null,"topics":["network","online","react-hooks"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/olefirenko.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-06-27T01:19:24.000Z","updated_at":"2023-03-18T02:13:47.000Z","dependencies_parsed_at":"2022-09-14T16:10:38.387Z","dependency_job_id":null,"html_url":"https://github.com/olefirenko/use-network-status","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olefirenko%2Fuse-network-status","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olefirenko%2Fuse-network-status/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olefirenko%2Fuse-network-status/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olefirenko%2Fuse-network-status/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/olefirenko","download_url":"https://codeload.github.com/olefirenko/use-network-status/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248844054,"owners_count":21170486,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["network","online","react-hooks"],"created_at":"2024-11-27T19:31:33.819Z","updated_at":"2025-04-14T07:51:04.512Z","avatar_url":"https://github.com/olefirenko.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 📡 React Hook to get the online status of the browser\n\nReact hook `useNetworkStatus()` returns whether the client's browser online with updates when the network state is changed.\n\n## Installation\n\nThe easiest way to use `useNetworkStatus` React hook is to install it from **npm** or **yarn**.\n\n```sh\nnpm install use-network-status --save\n```\n\nOr\n\n```sh\nyarn add use-network-status\n```\n\n## Usage\nPull the hook into your component (usually the root one) and call the hook inside the functional component. \n\n```js\nimport { useNetworkStatus } from \"use-network-status\";\n\nfunction App() {\n  const isOnline = useNetworkStatus();\n\n  return (\n    \u003cdiv className=\"status\"\u003e\n      {isOnline ? '📡 Online' : '📴 Offline'}\n    \u003c/div\u003e\n  );\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Folefirenko%2Fuse-network-status","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Folefirenko%2Fuse-network-status","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Folefirenko%2Fuse-network-status/lists"}