Skip to content

dhavalrauttech/is-this-url

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

is-this-url

Description

  • Check whether a string is a URL.
  • If string can be used as a URL by returning a Boolean value

Installation

npm install is-this-url

Code

const ValidateUrl = require("is-this-url"); 

// The below URL are valid URL
ValidateUrl("https://www.youtube.com/"); // true
ValidateUrl("www.youtube.com"); // true
ValidateUrl("youtube.com"); // true
ValidateUrl("https://www.youtube.com/watch?v=w3jLJU7DT5E"); // true

// The below URL are invalid URL
ValidateUrl("youtube"); // false
ValidateUrl("124"); // false 

CodeSandbox Example Click here

About

Library to check the string is a Uniform Resource Locator (URL)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published