{"id":13431216,"url":"https://github.com/sindresorhus/is-reachable","last_synced_at":"2025-05-15T18:04:26.896Z","repository":{"id":34217554,"uuid":"38075847","full_name":"sindresorhus/is-reachable","owner":"sindresorhus","description":"Check if servers are reachable","archived":false,"fork":false,"pushed_at":"2023-10-30T15:50:34.000Z","size":90,"stargazers_count":379,"open_issues_count":12,"forks_count":40,"subscribers_count":11,"default_branch":"main","last_synced_at":"2025-05-06T07:27:41.432Z","etag":null,"topics":["browser","connectivity","detect","internet","network","nodejs","online","ping","reachability"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/sindresorhus.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":".github/security.md","support":null,"governance":null,"roadmap":null,"authors":null},"funding":{"github":"sindresorhus","open_collective":"sindresorhus","custom":"https://sindresorhus.com/donate"}},"created_at":"2015-06-25T21:42:16.000Z","updated_at":"2025-04-27T00:13:02.000Z","dependencies_parsed_at":"2023-12-14T23:46:00.680Z","dependency_job_id":null,"html_url":"https://github.com/sindresorhus/is-reachable","commit_stats":{"total_commits":130,"total_committers":19,"mean_commits":6.842105263157895,"dds":0.5615384615384615,"last_synced_commit":"aa41a911fb0087c12aa80d797e7392a2ff001ae4"},"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Fis-reachable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Fis-reachable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Fis-reachable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Fis-reachable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sindresorhus","download_url":"https://codeload.github.com/sindresorhus/is-reachable/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253451562,"owners_count":21910730,"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":["browser","connectivity","detect","internet","network","nodejs","online","ping","reachability"],"created_at":"2024-07-31T02:01:01.411Z","updated_at":"2025-05-15T18:04:26.878Z","avatar_url":"https://github.com/sindresorhus.png","language":"JavaScript","funding_links":["https://github.com/sponsors/sindresorhus","https://opencollective.com/sindresorhus","https://sindresorhus.com/donate"],"categories":["JavaScript","nodejs","Fingerprint"],"sub_categories":["IP"],"readme":"# is-reachable\n\n\u003e Check if servers are reachable\n\nWorks in Node.js and the browser *(with a bundler)*.\n\nThe Node.js version will do a TCP handshake with the target's port. It attempts to detect cases where a router redirects the request to itself.\n\nThe browser version is limited by the fact that browsers cannot connect to arbitrary ports. It only supports HTTP and HTTPS and the check relies on the `/favicon.ico` path being present.\n\n## Install\n\n```\n$ npm install is-reachable\n```\n\n## Usage\n\n```js\nconst isReachable = require('is-reachable');\n\n(async () =\u003e {\n\tconsole.log(await isReachable('sindresorhus.com'));\n\t//=\u003e true\n\n\tconsole.log(await isReachable('google.com:443'));\n\t//=\u003e true\n})();\n```\n\n## API\n\n### isReachable(targets, options?)\n\nReturns a `Promise\u003cboolean\u003e` which is `true` if any of the `targets` are reachable.\n\n#### targets\n\nType: `string | string[]`\n\nOne or more targets to check. Can either be `hostname:port`, a URL like `https://hostname:port` or even just `hostname`. `port` must be specified if protocol is not `http:` or `https:` and defaults to `443`. Protocols other than `http:` and `https:` are not supported.\n\n#### options\n\nType: `object`\n\n##### timeout\n\nType: `number`\\\nDefault: `5000`\n\nTimeout in milliseconds after which a request is considered failed.\n\n*Node.js only*\n\n## Related\n\n- [is-online](https://github.com/sindresorhus/is-online) - Check if the internet connection is up\n\n## Maintainers\n\n- [Sindre Sorhus](https://github.com/sindresorhus)\n- [silverwind](https://github.com/silverwind)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsindresorhus%2Fis-reachable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsindresorhus%2Fis-reachable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsindresorhus%2Fis-reachable/lists"}