Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Validate url #1186
Used NodeJs's URL module, the module provides a class that is implemented by following WHATWG's URL Standard (Link to the documentation)
When a string is passed as an argument to the constructor, if the stirng is a valid URL, it returns an object, that contains parsed URL (see example below). If the given string is not a valid URL string, then it throws an error stating the given string is an invalid URL.
Example for the value returned by WHATWG's URL API:
Implementation details of making valid URL clickable in the response header
Implementation details of the validateURL module