is-valid-http
v2.0.1
Published
Check if a string is a HTTP/HTTPS
Downloads
2,140
Maintainers
Readme
is-valid-http
Check if a string is a HTTP/HTTPS
Install
$ npm install is-valid-http
Usage
const isUrlCheck = require('is-valid-http');
isUrlCheck('https://example.com'); //=> true
isUrlCheck('http://example.com'); //=> true
isUrlCheck('https://localhost'); //=> true
isUrlCheck('http://localhost'); //=> true
isUrlCheck('example.com'); //=> false
isUrlCheck('https://example'); //=> false
isUrlCheck('ftp://example'); //=> false
isUrlCheck('gopher://example'); //=> false
isUrlCheck('notvalidurl'); // => false