remusao / Tldts
Licence: mit
JavaScript Library to work against complex domain names, subdomains and URIs.
Stars: ✭ 151
Programming Languages
javascript
184084 projects - #8 most used programming language
typescript
32286 projects
Labels
Projects that are alternatives of or similar to Tldts
uri
A type to represent, query, and manipulate a Uniform Resource Identifier.
Stars: ✭ 16 (-89.4%)
Mutual labels: url, uri, url-parsing
Scala Uri
Simple scala library for building and parsing URIs
Stars: ✭ 225 (+49.01%)
Mutual labels: url, uri, url-parsing
Pyfunceble
The tool to check the availability or syntax of domain, IP or URL.
Stars: ✭ 143 (-5.3%)
Mutual labels: url, domain
Parse Domain
Splits a hostname into subdomains, domain and (effective) top-level domains.
Stars: ✭ 261 (+72.85%)
Mutual labels: url, domain
UrlCombine
C# util for combining Url paths. Works similarly to Path.Combine.
Stars: ✭ 23 (-84.77%)
Mutual labels: url, uri
tall
Promise-based, No-dependency URL unshortner (expander) module for Node.js
Stars: ✭ 56 (-62.91%)
Mutual labels: url, url-parsing
Searchwithmybrowser
Open Cortana searches with your default browser.
Stars: ✭ 285 (+88.74%)
Mutual labels: url, uri
Libvmod Querystring
Query-string module for Varnish Cache
Stars: ✭ 85 (-43.71%)
Mutual labels: url, url-parsing
uri-query-parser
a parser and a builder to work with URI query string the right way in PHP
Stars: ✭ 38 (-74.83%)
Mutual labels: url, uri
Linkt
A lightweight and simple Kotlin library for deep link handling on Android 🔗.
Stars: ✭ 101 (-33.11%)
Mutual labels: url, uri
Frontexpress
An Express.js-Style router for the front-end
Stars: ✭ 263 (+74.17%)
Mutual labels: url, url-parsing
Kit-UrlParser
RFC 3986 compliant url parsing library with PSR-7 Uri component
Stars: ✭ 31 (-79.47%)
Mutual labels: uri, url-parsing
tldts - Blazing Fast URL Parsing
tldts
is a JavaScript library to extract hostnames, domains, public suffixes, top-level domains and subdomains from URLs.
Features:
- Tuned for performance (order of 0.1 to 1 μs per input)
- Handles both URLs and hostnames
- Full Unicode/IDNA support
- Support parsing email addresses
- Detect IPv4 and IPv6 addresses
- Continuously updated version of the public suffix list
-
TypeScript, ships with
umd
,esm
,cjs
bundles and type definitions - Small bundles and small memory footprint
- Battle tested: full test coverage and production use
Install
npm install --save tldts
Usage
Using the command-line interface:
$ npx tldts 'http://www.writethedocs.org/conf/eu/2017/'
{
"domain": "writethedocs.org",
"domainWithoutSuffix": "writethedocs",
"hostname": "www.writethedocs.org",
"isIcann": true,
"isIp": false,
"isPrivate": false,
"publicSuffix": "org",
"subdomain": "www"
}
Programmatically:
const { parse } = require('tldts');
// Retrieving hostname related informations of a given URL
parse('http://www.writethedocs.org/conf/eu/2017/');
// { domain: 'writethedocs.org',
// domainWithoutSuffix: 'writethedocs',
// hostname: 'www.writethedocs.org',
// isIcann: true,
// isIp: false,
// isPrivate: false,
// publicSuffix: 'org',
// subdomain: 'www' }
Modern ES6 modules import is also supported:
import { parse } from 'tldts';
Alternatively, you can try it directly in your browser here: https://npm.runkit.com/tldts
Check README.md for more details about the API.
Contributors
tldts
is based upon the excellent tld.js
library and would not exist without
the many contributors who worked on the project.
This project would not be possible without the amazing Mozilla's public suffix list either. Thank you for your hard work!
License
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].