Naivete Precedes Misrepresentation
    Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

    url-validatorpublic

    url validator

    NPM version Build status Test coverage Dependency Status License Downloads Gittip

    Opinionated URL validator.

    • Does not support raw domains like github.com, though I wish there was a smart way to do so
    • Defaults protocol-less URLs like //github.com/ to HTTPs like https://github.com/
    • Domains will always have trailing slashes
    • Encode components

    API

    var url = validate(url)

    var validate = require('url-validator')
     
    var url = validate('//github.com')
    // => 'https://github.com/'

    If the url is invalid, then url will be false

    Keywords

    install

    npm i url-validator

    Downloadsweekly downloads

    76

    version

    2.0.3

    license

    MIT

    repository

    githubgithub

    last publish

    collaborators

    • avatar