A small library that checks if a URL is online or not

Usage no npm install needed!

<script type="module">
  import isUrlOnline from '';


Is URL Online?

A 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.

Only supports server side apps.

npm bundle size npm node-current npm

Getting started

pnpm install is-url-online


npm install is-url-online


yarn add is-url-online

Improvements over other libraries

  • Promise based usage.
  • Works on both CommonJs and EsModule based libraries.
  • Smaller install size because of just one dependency.
  • Built using typescript.
  • Catches invalid URLs.
  • Actively maintained.
  • Automated Dependency update and publishing after successful tests.
  • Has helper methods to deal with extra usecases.


import { isUrlOnline } from "is-url-online";

await isUrlOnline(""); //-> true
//=> true

await isUrlOnline(""); //-> false

await isUrlOnline("notaurl"); //-> false

await isUrlOnline("ttps:// abcd"); //-> true
//because of a space in middle.


Only Check URL String

This helper method will validate the URL string without checking it online.

import { isUrlString } from "is-url-online";

await isUrlString(""); //-> true

await isUrlString(""); //-> false

await isUrlString("notaurl"); //-> false

It uses URL module under the hood.


This helper method prepend https:// or http:// to humanized URLs like and localhost

import { prependHttp } from "is-url-online";
// HTTPS is enabled by default.
prependHttp({ url: "" }); //->
prependHttp({ url: "", https: false }); //->

Visualization of this Repo.

![Visualization of this repo](./diagram.svg