Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/afeiship/root-domain
Extract root domain name from an URL.
https://github.com/afeiship/root-domain
ajax args arguments fetch http next parse request
Last synced: 12 days ago
JSON representation
Extract root domain name from an URL.
- Host: GitHub
- URL: https://github.com/afeiship/root-domain
- Owner: afeiship
- License: mit
- Created: 2020-06-29T00:58:34.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-09-24T13:07:15.000Z (over 1 year ago)
- Last Synced: 2024-12-02T04:48:48.978Z (24 days ago)
- Topics: ajax, args, arguments, fetch, http, next, parse, request
- Language: TypeScript
- Homepage:
- Size: 42 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# root-domain
> Extract root domain name from an URL.[![version][version-image]][version-url]
[![license][license-image]][license-url]
[![size][size-image]][size-url]
[![download][download-image]][download-url]## installation
```shell
npm install @jswork/root-domain
```## usage
```js
import rd from '@jswork/root-domain';rd('www.baidu.com'); // baidu.com
rd('https://api.js.work:8080/v1/user'); // js.work
rd('http://localhost'); // localhost
```## license
Code released under [the MIT license](https://github.com/afeiship/root-domain/blob/master/LICENSE.txt).[version-image]: https://img.shields.io/npm/v/@jswork/root-domain
[version-url]: https://npmjs.org/package/@jswork/root-domain[license-image]: https://img.shields.io/npm/l/@jswork/root-domain
[license-url]: https://github.com/afeiship/root-domain/blob/master/LICENSE.txt[size-image]: https://img.shields.io/bundlephobia/minzip/@jswork/root-domain
[size-url]: https://github.com/afeiship/root-domain/blob/master/dist/root-domain.min.js[download-image]: https://img.shields.io/npm/dm/@jswork/root-domain
[download-url]: https://www.npmjs.com/package/@jswork/root-domain