{"id":20535416,"url":"https://github.com/xiscodev/connection-checker","last_synced_at":"2026-03-08T02:10:32.697Z","repository":{"id":55483560,"uuid":"242499465","full_name":"xiscodev/connection-checker","owner":"xiscodev","description":"A simple library to know the state of internet connection.","archived":false,"fork":false,"pushed_at":"2020-12-27T23:07:30.000Z","size":54,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-01T12:09:26.054Z","etag":null,"topics":["checker","connection","javascript","library","network"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/connection-checker","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xiscodev.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-02-23T10:47:54.000Z","updated_at":"2025-08-27T12:22:25.000Z","dependencies_parsed_at":"2022-08-15T01:20:44.960Z","dependency_job_id":null,"html_url":"https://github.com/xiscodev/connection-checker","commit_stats":null,"previous_names":["deepertech-com/connection-checker"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/xiscodev/connection-checker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xiscodev%2Fconnection-checker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xiscodev%2Fconnection-checker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xiscodev%2Fconnection-checker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xiscodev%2Fconnection-checker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xiscodev","download_url":"https://codeload.github.com/xiscodev/connection-checker/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xiscodev%2Fconnection-checker/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30242406,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-08T00:58:18.660Z","status":"online","status_checked_at":"2026-03-08T02:00:06.215Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["checker","connection","javascript","library","network"],"created_at":"2024-11-16T00:31:12.344Z","updated_at":"2026-03-08T02:10:32.678Z","avatar_url":"https://github.com/xiscodev.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv style=\"display: -ms-flexbox; display: -webkit-flex; display: flex; -webkit-flex-direction: row; -ms-flex-direction: row; flex-direction: row; -webkit-flex-wrap: wrap; -ms-flex-wrap: wrap; flex-wrap: wrap; -webkit-justify-content: center; -ms-flex-pack: center; justify-content: center; -webkit-align-content: center; -ms-flex-line-pack: center; align-content: center; -webkit-align-items: center; -ms-flex-align: center; align-items: center;\"\u003e\n  \u003cimg style=\"-webkit-order: 0; -ms-flex-order: 0; order: 0; -webkit-flex: 0 1 auto; -ms-flex: 0 1 auto; flex: 0 1 auto; -webkit-align-self: auto; -ms-flex-item-align: auto; align-self: auto;\" src=\"icon.png\" /\u003e\n\u003c/div\u003e\n\n\u003ch1 style=\"text-align:center;\"\u003eConnection Checker\u003c/h1\u003e\n\n## Why\nSometimes [window.navigator.onLine](https://developer.mozilla.org/en-US/docs/Web/API/NavigatorOnLine.onLine) API is not available and we need a good way to check if we got internet connection.\n\n## What is this?\nA simple library to know the state of internet connection.\n\n## How to use it?\nFirst you need to import it in your project\n\n_The require way_\n\n```js\nlet { ConnectionEvent, startChecker } = require(\"connection-checker\");\n```\n\n_The import way_\n\n```js\nimport { ConnectionEvent, checkOnDemand } from \"connection-checker\";\n```\n\nThen use it to know your state one time on demand\n\n```js\n  window.addEventListener(ConnectionEvent.ON_NETWORK_CONNECTED, function() {\n    // YOUR OWN CODE AND STUFF\n  })\n\n  checkOnDemand()\n```\n\nOr frequently (every 10 secs)\n\n```js\n  window.addEventListener(ConnectionEvent.ON_NETWORK_CHANGED, function() {\n    // YOUR OWN CODE AND STUFF\n  })\n\n  startChecker()\n```\nYou can always refer to library documentation [here](api.md)\n\nPowered by \u003ca href=\"https://deepertech.com\" target=\"_blank\"\u003eDeepertech\u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxiscodev%2Fconnection-checker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxiscodev%2Fconnection-checker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxiscodev%2Fconnection-checker/lists"}