{"id":20046182,"url":"https://github.com/spa5k/is-url-online","last_synced_at":"2025-10-29T03:40:24.509Z","repository":{"id":45198345,"uuid":"393345636","full_name":"spa5k/is-url-online","owner":"spa5k","description":"A lightweight library for checking if a url is down or not.","archived":false,"fork":false,"pushed_at":"2022-08-09T06:47:12.000Z","size":154360,"stargazers_count":5,"open_issues_count":1,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-04-08T20:51:19.550Z","etag":null,"topics":["esbuild","isitdown","isitup","library","nodejs","typescript"],"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/spa5k.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2021-08-06T10:43:38.000Z","updated_at":"2023-03-21T05:15:24.000Z","dependencies_parsed_at":"2022-08-12T11:41:06.651Z","dependency_job_id":null,"html_url":"https://github.com/spa5k/is-url-online","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":"spa5k/esbuild-typescript-library-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spa5k%2Fis-url-online","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spa5k%2Fis-url-online/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spa5k%2Fis-url-online/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spa5k%2Fis-url-online/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/spa5k","download_url":"https://codeload.github.com/spa5k/is-url-online/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252471434,"owners_count":21753179,"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":["esbuild","isitdown","isitup","library","nodejs","typescript"],"created_at":"2024-11-13T11:21:41.731Z","updated_at":"2025-10-29T03:40:23.622Z","avatar_url":"https://github.com/spa5k.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Is URL Online?\n\nA lightweight library for checking if a url is down or not. Pretty useful while checking if the url inserted is correct one or fake one as normal url checking methods won't work.\n\n**Supports both Server and browser due to [ohmyfetch](https://github.com/unjs/ohmyfetch)**\n\n![npm bundle size](https://img.shields.io/bundlephobia/minzip/is-url-online?logo=files\u0026style=for-the-badge)\n\n[![NPM downloads](https://img.shields.io/npm/dm/is-url-online.svg?style=for-the-badge)](https://www.npmjs.com/package/is-url-online)\n[![npm](https://img.shields.io/npm/v/is-url-online?logo=npm\u0026style=for-the-badge)](https://www.npmjs.com/package/is-url-online)\n![node-current](https://img.shields.io/badge/Node-%3E=14-success?style=for-the-badge\u0026logo=node)\n\n## Getting started\n\n`pnpm install is-url-online`\n\nor\n\n`npm install is-url-online`\n\nor\n\n`yarn add is-url-online`\n\n## Improvements over other libraries\n\n- Promise based usage.\n\n- Works on both CommonJs and EsModule based libraries.\n\n- Smaller install size because of just one dependency.\n\n- Built using typescript.\n\n- Catches invalid URLs.\n\n- Actively maintained.\n\n- Automated Dependency update and publishing after successful tests.\n\n- Has helper methods to deal with extra usecases.\n\n## Usage\n\n```ts\nimport { isUrlOnline } from \"is-url-online\";\n\nawait isUrlOnline(\"https://github.com/spa5k/is-url-online\"); //-\u003e true\n\nawait isUrlOnline(\"https://github.com/spa5k/notarepo\"); //-\u003e false\n\nawait isUrlOnline(\"notaurl\"); //-\u003e false\n\nawait isUrlOnline(\"ttps://github.com/spa5k/is-url-online abcd\"); //-\u003e false\n//because of a space in middle.\n```\n\n## Utils\n\n### Only Check URL String\n\nThis helper method will validate the URL string without checking it online.\n\n```ts\nimport { isUrlString } from \"is-url-online\";\n\nawait isUrlString(\"https://google.com\"); //-\u003e true\n\nawait isUrlString(\"https://google.com/404ingURL\"); //-\u003e true\n\nawait isUrlString(\"notaurl\"); //-\u003e false\n```\n\nIt uses URL module under the hood.\n\n### Prepend HTTP/HTTPS\n\nThis helper method prepend `https://` or `http://` to humanized URLs like `github.com` and `localhost`\n\n```ts\nimport { prependHttp } from \"is-url-online\";\n\n// HTTPS is enabled by default.\n\nprependHttp({ url: \"github.com\" }); //-\u003e https://github.com\n\nprependHttp({ url: \"github.com\", https: false }); //-\u003e http://github.com\n```\n\n### Visualization of this Repo.\n\n![Visualization of this repo](./diagram.svg)\n\n### References.\n\n- [`url-exists`](https://github.com/boblauer/url-exists)\n\n- [`is-url-superb`](https://github.com/sindresorhus/is-url-superb)\n\n- [`prepend-http`](https://github.com/sindresorhus/prepend-http)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspa5k%2Fis-url-online","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspa5k%2Fis-url-online","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspa5k%2Fis-url-online/lists"}