https://github.com/richienb/url-exist
Check if a URL exists.
https://github.com/richienb/url-exist
Last synced: 9 months ago
JSON representation
Check if a URL exists.
- Host: GitHub
- URL: https://github.com/richienb/url-exist
- Owner: Richienb
- License: mit
- Created: 2019-11-30T05:56:14.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2022-08-11T08:33:30.000Z (over 3 years ago)
- Last Synced: 2025-03-29T20:51:09.502Z (10 months ago)
- Language: JavaScript
- Homepage:
- Size: 294 KB
- Stars: 14
- Watchers: 2
- Forks: 3
- Open Issues: 6
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# URL Exist
Check if a URL exists.
[](https://npmjs.com/package/url-exist)
## Install
```sh
npm install url-exist
```
## Improvements over [`url-exists`](https://github.com/boblauer/url-exists)
- Promise interface.
- Works cross-platform.
- Smaller install size.
- Typescript support included.
- Catches invalid URLs.
- Actively maintained.
## Usage
```js
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.