is-valid-http-url

1.0.3 • Public • Published

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

Package Sidebar

Install

npm i is-valid-http-url

Weekly Downloads

3,815

Version

1.0.3

License

MIT

Unpacked Size

3.31 kB

Total Files

4

Last publish

Collaborators

  • neosiae