You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Performant domain name extraction. No regex or array magic.
5
+
This package provides a performant way to extract domain names from URLs without using regular expressions or array manipulations.
7
6
8
-
[What is an URL](https://developer.mozilla.org/en-US/docs/Learn/Common_questions/What_is_a_URL)
7
+
Learn more about [What is a URL](https://developer.mozilla.org/en-US/docs/Learn/Common_questions/What_is_a_URL)
9
8
10
-
However. This package will also remove the sub domain, and unless the TLD option is used, anything other than the domain and second level domain (so www.example.co.uk would return co.uk)
11
9
12
10
## Supports
13
11
14
-
Browser and Node.
12
+
Both the browser and nodejs.
15
13
16
14
## Usage
17
15
16
+
### Installation
18
17
```bash
19
18
$ npm i --save extract-domain
20
19
```
21
20
22
-
- urls = string|array
23
-
- returns string|array
21
+
### API
22
+
- urls: A string or an array of URLs.
23
+
- options { tld: true }: If it should take TLD domains to consideration (i.e. .co.uk)
24
+
- returns: A string representing the extracted domain name or an array of domain names.
0 commit comments