package
Determine whether a value is a URL instance.
npm install isurlGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
Determine whether a value is a
URLinstance.
Works cross-realm/iframe and despite Symbol.toStringTag.
[!NOTE]
If you need to support older versions of Node.js (going back to
8.x), use4.xof this package.
npm install isurlThe standard.
import isURL from 'isurl';
isURL('http://domain/'); //-> false
isURL(new URL('http://domain/')); //-> trueAcceptance can be extended to incomplete URL implementations that lack origin, searchParams and toJSON properties (which is common with web browsers from 2021):
import isURL from 'isurl/lenient';
console.log(url.searchParams); //-> undefined
isURL(url); //-> trueEstimated unpacked size across 5 packages.
76.4 kB
Includes dependencies.
3 direct dependencies.