domain-from-partial-url

1.1.0 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i domain-from-partial-url

Weekly Downloads

28

Version

1.1.0

License

LGPL-3.0+

Unpacked Size

50.3 kB

Total Files

8

Last publish

Collaborators

  • strugee