node package manager


Loosely validate a URL

url validator

Opinionated URL validator.

  • Does not support raw domains like, though I wish there was a smart way to do so
  • Defaults protocol-less URLs like // to HTTPs like
  • Domains will always have trailing slashes
  • Encode components
var validate = require('url-validator')
var url = validate('//')
// => '' 

If the url is invalid, then url will be false