New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

url-validator

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

url-validator

Loosely validate a URL

latest
Source
npmnpm
Version
2.0.3
Version published
Weekly downloads
184
-9.8%
Maintainers
1
Weekly downloads
 
Created
Source

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

url

FAQs

Package last updated on 09 Dec 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts