is-url-umd
v2.0.6
Published
🔨 Tells you that string is in URL format. Library in UMD style.
Maintainers
Readme
is-url-umd
🔨 Tells you that string is in URL format. Library in UMD style.
Usage
Installation:
npm install is-url-umdvar 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.
