1.0.3 • Published 5 years ago

is-valid-http-url v1.0.3

Weekly downloads
2,093
License
MIT
Repository
github
Last release
5 years ago

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