url-exists-nodejs
TypeScript icon, indicating that this package has built-in type declarations

0.2.4 • Public • Published

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

Package Sidebar

Install

npm i url-exists-nodejs

Weekly Downloads

198

Version

0.2.4

License

MIT

Unpacked Size

2.92 kB

Total Files

4

Last publish

Collaborators

  • nwaughachukwuma