🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more

domain-from-partial-url

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

domain-from-partial-url

Turn a URL, no matter how incomplete, into its domain name

1.1.0
latest
Version published
Weekly downloads
292
-23.96%
Maintainers
1
Weekly downloads
 
Created

domain-from-partial-url

Build Status Coverage Status npm Greenkeeper badge

Turn a URL, no matter how incomplete, into its domain name

Installation

npm install domain-from-partial-url

Usage

The module exports a single function which will take a vaguely URL-like thing and spit out a domain. For example:

var domainFromPartialUrl = require('domain-from-partial-url');

domainFromPartialUrl('example.com'); // example.com
domainFromPartialUrl('http://example.com'); // example.com
domainFromPartialUrl('example.com/someinfo.html'); // example.com
domainFromPartialUrl('https://example.com/lots/of/stuff/index.html'); // example.com

License

LGPL 3.0+

Author

AJ Jordan alex@strugee.net

Keywords

FAQs

Package last updated on 19 May 2018

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