https://github.com/strugee/node-domain-from-partial-url
Turn a URL, no matter how incomplete, into its domain name
https://github.com/strugee/node-domain-from-partial-url
domain hacktoberfest nodejs npm-module url
Last synced: about 2 months ago
JSON representation
Turn a URL, no matter how incomplete, into its domain name
- Host: GitHub
- URL: https://github.com/strugee/node-domain-from-partial-url
- Owner: strugee
- License: lgpl-3.0
- Created: 2017-08-15T07:18:50.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2020-06-01T01:26:08.000Z (about 6 years ago)
- Last Synced: 2025-10-11T05:41:40.870Z (9 months ago)
- Topics: domain, hacktoberfest, nodejs, npm-module, url
- Language: JavaScript
- Homepage:
- Size: 106 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: COPYING
Awesome Lists containing this project
README
# `domain-from-partial-url`
[](http://travis-ci.org/strugee/node-domain-from-partial-url)
[](https://coveralls.io/github/strugee/node-domain-from-partial-url?branch=master)
[](https://npmjs.com/package/domain-from-partial-url)
[](https://greenkeeper.io/)
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:
```js
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