SebastienElet/get-domain-from-url

View on GitHub
README.md

Summary

Maintainability
Test Coverage
<!--
# This file is automatically generated by a `metapak`
# module. Do not change it elsewhere, changes would
# be overriden.
-->
# get-domain-from-url
> Get domain from an url

[![NPM version](https://badge.fury.io/js/get-domain-from-url.svg)](https://npmjs.org/package/get-domain-from-url)
[![Build status](https://secure.travis-ci.org/SebastienElet/get-domain-from-url.svg)](https://travis-ci.org/SebastienElet/get-domain-from-url)
[![Dependency Status](https://david-dm.org/SebastienElet/get-domain-from-url.svg)](https://david-dm.org/SebastienElet/get-domain-from-url)
[![devDependency Status](https://david-dm.org/SebastienElet/get-domain-from-url/dev-status.svg)](https://david-dm.org/SebastienElet/get-domain-from-url#info=devDependencies)
[![Code Climate](https://codeclimate.com/github/SebastienElet/get-domain-from-url.svg)](https://codeclimate.com/github/SebastienElet/get-domain-from-url)
[![Dependency Status](https://dependencyci.com/github/SebastienElet/get-domain-from-url/badge)](https://dependencyci.com/github/SebastienElet/get-domain-from-url)

# Usage

```javascript
const getDomain = require('get-domain-from-url');
getDomain('mail.google.com'); // google.com
getDomain('mail.google.co.uk'); // google.co.uk
getDomain('0.0.0.0:1664'); // ''
```

# License
[MIT](https://github.com/SebastienElet/get-domain-from-url/blob/master/LICENSE)