url-exists-nodejs
v0.2.4
Published
A node.js library to check if a url exists (with zero dependencies)
Downloads
658
Maintainers
Readme
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