npm.io
1.0.3 • Published 6 years ago

is-valid-http-url

Licence
MIT
Version
1.0.3
Deps
0
Size
3 kB
Vulns
0
Weekly
0
Stars
7

is-valid-http-url

Build Status

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