# tldextract

> Extract domain, subdomain and tld from a url

Latest version **0.0.5** (published 2016-02-25) · 0 weekly downloads

## Install

```sh
npm install tldextract
pnpm add tldextract
yarn add tldextract
bun add tldextract
```

## Health

**Score 10/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; low quality score; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.5 |
| Published | 2016-02-25 |
| First published | 2011-09-17 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 0.4.0 |
| Dependencies | 1 |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 36 |
| Author | Pau Ramon |
| Maintainers | masylum |
| Keywords | url, domain, subdomaon, tld, parse |

## Links

- npm: https://www.npmjs.com/package/tldextract
- Repository: https://github.com/masylum/tldextract
- Homepage: https://github.com/masylum/tldextract#readme
- Issues: https://github.com/masylum/tldextract/issues
- npm.io page: https://npm.io/package/tldextract

## Dependencies (1)

- [request](https://npm.io/package/request.md) 2.2.9

## Alternatives

- [babylon](https://npm.io/package/babylon.md) — 5.1M weekly downloads
- [csscolorparser](https://npm.io/package/csscolorparser.md) — 3.7M weekly downloads
- [expr-eval-fork](https://npm.io/package/expr-eval-fork.md) — 1.5M weekly downloads
- [@leeoniya/ufuzzy](https://npm.io/package/@leeoniya/ufuzzy.md) — 247.7K weekly downloads
- [xml-parser](https://npm.io/package/xml-parser.md) — 78.4K weekly downloads

## Recent versions

- 0.0.5 (latest) — 2016-02-25
- 0.0.4 — 2011-12-10
- 0.0.3 — 2011-09-18
- 0.0.2 — 2011-09-18
- 0.0.1 — 2011-09-17

## README

# tldextract

Accurately separates the gTLD or ccTLD (generic or country code
top-level domain) from the registered domain and subdomains of a URL.

## How does it work?

``` javascript
var tldextract = require('tldextract');

tldextract('http://forums.news.cnn.com/', function (err, obj) {
  // obj: {subdomain: 'forums.news', domain: 'cnn', tld: 'com'}
});

tldextract('http://ye.ye.ye.ye/', function (err, obj) {
  // obj: {subdomain: 'ye', domain: 'ye', tld: 'ye.ye'}
});
```

## tests

``` bash
make
```

## Disclaimer

This module is a port of the python module [tldextract](https://github.com/john-kurkowski/tldextract).

---
_Source: https://npm.io/package/tldextract · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
