Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nwaughachukwuma/url-exists-nodejs
A node.js library to check if a url exists (with zero dependencies)
https://github.com/nwaughachukwuma/url-exists-nodejs
Last synced: about 1 month ago
JSON representation
A node.js library to check if a url exists (with zero dependencies)
- Host: GitHub
- URL: https://github.com/nwaughachukwuma/url-exists-nodejs
- Owner: nwaughachukwuma
- Created: 2021-02-18T07:55:41.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-08-11T19:20:42.000Z (over 2 years ago)
- Last Synced: 2024-10-31T18:11:51.332Z (2 months ago)
- Language: JavaScript
- Size: 350 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# url-exists-nodejs
A node.js library to check if a url exists (with zero dependencies)
## Install
```bash
# pnpm
pnpm install url-exists-nodejs# yarn
yarn add url-exists-nodejs# npm
npm install url-exists-nodejs
``````js
import urlExists from 'url-exists-nodejs'
```## API
```ts
urlExists(url: string): Promise
```## Usage
```js
await urlExists('https://google.com') // => true// a well typed url that can't be found
await urlExists('https://httpbin.org/status/404') // => falseawait urlExists('not-a-valid-url') // => false
// can deep check a redirect url
await urlExists('https://bit.ly/300awAn') // => true
```