Skip to content

Richienb/url-exist

Repository files navigation

URL Exist

Check if a URL exists.

NPM Badge

Install

npm install url-exist

Improvements over url-exists

  • Promise interface.
  • Works cross-platform.
  • Smaller install size.
  • Typescript support included.
  • Catches invalid URLs.
  • Actively maintained.

Usage

import urlExist from "url-exist"

await urlExist("https://google.com")
//=> true

await urlExist("https://google.com/404ingURL")
//=> false
 
await urlExist("notaurl")
//=> false

API

urlExist(url)

url

Type: string

The URL to check.