JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3250
  • Score
    100M100P100Q116137F
  • License MIT

Check if a URL exists.

Package Exports

  • url-exist

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (url-exist) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

URL Exist Travis CI Build Status

Check if a URL exists.

NPM Badge

Install

npm install url-exist

Improvements over url-exists

  • Promise interface.
  • Works cross-platform.
  • 87% smaller install size.
  • Typescript supported included.
  • Catches invalid URLs.
  • Actively maintained.

Usage

const urlExist = require("url-exist");

(async () => {
    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.

Migrating from v1

  • Node.js 10 or later is now required.
  • Support for callbacks have been removed.