Skip to content

Latest commit

 

History

History
40 lines (27 loc) · 645 Bytes

README.md

File metadata and controls

40 lines (27 loc) · 645 Bytes

url-exists-nodejs

A node.js library to check if a url exists (with zero dependencies)

Install

# pnpm
pnpm install url-exists-nodejs

# yarn
yarn add url-exists-nodejs

# npm
npm install url-exists-nodejs
import urlExists from 'url-exists-nodejs'

API

urlExists(url: string): Promise<boolean>

Usage

await urlExists('https://google.com') // => true

// a well typed url that can't be found
await urlExists('https://httpbin.org/status/404') // => false

await urlExists('not-a-valid-url') // => false

// can deep check a redirect url
await urlExists('https://bit.ly/300awAn') // => true