is-url-umd
v2.0.5
Published
🔨 Tells you that string is in URL format. Library in UMD style.
Downloads
41
Maintainers
Readme
is-url-umd
🔨 Tells you that string is in URL format. Library in UMD style.
Install
npm install is-url-umd
Usage
var isURL = require('is-url-umd');
if (isURL(string)) {
console.log('it is string :)');
} else {
console.log('this is not a string :(');
}
How it works?
In package is-url
we can find run function .test()
on RegExp:
/^(?:\w+:)?\/\/([^\s\.]+\.\S{2}|localhost[\:?\d]*)\S*$/
... and it is returns boolean
.
Support
Library in UMD format, so support all kinds of exports:
- AMD
- CommonJS
- typical global variable
Dependencies
Use https://www.npmjs.com/package/is-url to support isURL
function.