url-exist

Check if a URL exists.

Usage no npm install needed!

<script type="module">
  import urlExist from 'https://cdn.skypack.dev/url-exist';
</script>

README

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.