JSPM

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

Checks whether a value is a WHATWG URL.

Package Exports

  • isurl

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 (isurl) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

isurl NPM Version Build Status Dependency Monitor

Checks whether a value is a WHATWG URL.

Works cross-realm/iframe and despite Symbol.toStringTag.

Installation

Node.js >= 6 is required. To install, type this at the command line:

npm install isurl

Usage

const isURL = require('isurl');

isURL('http://domain/');  //-> false
isURL(new URL('http://domain/'));  //-> true

Optionally, acceptance can be extended to incomplete URL implementations that lack searchParams (which are common in many modern web browsers):

const url = new URL('http://domain/?query');

console.log(url.searchParams);  //-> undefined

isURL.lenient(url);  //-> true