Check if an URL is a valid HTTP URL.


Keywords
boolean, check, http, https, is, url, whatwg
License
MIT
Install
npm install is-url-http@2.3.8

Documentation

is-url-http

Last version Coverage Status NPM Status

Check if an URL is a valid HTTP URL.

Install

$ npm install is-url-http --save

Usage

const isUrlHttp = require('is-url-http')

isUrlHttp('https://kikobeats.com') // ==> true
isUrlHttp('https://kikobeats.com') // ==> true
isUrlHttp('mailto://kiko@beats.com') // ==> false
isUrlHttp('callto:192.168.103.77+type=ip') // ==> false

If you need to run the package in a browser environment, you can save some bytes using the lightweight version:

const isUrlHttp = require('is-url-http/lightweight')

isUrlHttp('https://kikobeats.com') // ==> true
isUrlHttp('https://kikobeats.com') // ==> true
isUrlHttp('mailto://kiko@beats.com') // ==> false
isUrlHttp('callto:192.168.103.77+type=ip') // ==> false

License

is-url-http © Kiko Beats, released under the MIT License.
Authored and maintained by Kiko Beats with help from contributors.

kikobeats.com · GitHub Kiko Beats · Twitter @Kikobeats