url-domain-name
Version:
Get domain name from url
51 lines (29 loc) • 1.11 kB
Markdown
[](https://travis-ci.com/arshadkazmi42/url-domain-name/)
Get domain name from url
```
npm i url-domain-name
```
```javascript
const Domain = require('url-domain-name');
domainName = Domain.from('https://github.com/arshadkazmi42');
console.log(domainName);
// Output
// github.com
domainName = Domain.from('https://mail.google.com/arshadkazmi42');
console.log(domainName);
// Output
// mail.google.com
```
- **from(url)**
- Returns domain name from input url
Interested in contributing to this project?
You can log any issues or suggestion related to this library [here](https://github.com/arshadkazmi42/url-domain-name/issues/new)
Read our contributing [guide](CONTRIBUTING.md) on getting started with contributing to the codebase
Thank you to all the contributors who have helped us in making this project better :raised_hands:
<a href="https://github.com/arshadkazmi42"><img src="https://github.com/arshadkazmi42.png" width="30" /></a>