is-valid-http-url
v1.0.3
Published
Check whether a string is a valid HTTP URL
Downloads
15,349
Maintainers
Readme
is-valid-http-url
Check whether a string is a valid HTTP URL
This module is based on a gist by Diego Perini.
Install
Install is-valid-http-url using npm:
npm install --save is-valid-http-url
Or via yarn:
yarn add is-valid-http-url
Usage
const isUrl = require("is-valid-http-url");
isUrl("http://example.com"); // true
isUrl("https://www.example.com/foo/?bar=baz&inga=42&quux"); // true
isUrl("example.com"); // false
isUrl("http://foo.bar?q=Spaces should be encoded"); // false
License
MIT