JSPM

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

Determines 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 File Size Build Status Dependency Monitor

Determines whether a value is a WHATWG URL.

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

Installation

Node.js >= 8 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 origin, searchParams and toJSON properties (which are common in many modern web browsers):

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

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

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