All Projects → remusao → Tldts

remusao / Tldts

Licence: mit
JavaScript Library to work against complex domain names, subdomains and URIs.

Programming Languages

javascript
184084 projects - #8 most used programming language
typescript
32286 projects

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
Uri Parser
RFC3986/RFC3987 compliant URI parser
Stars: ✭ 342 (+126.49%)
Mutual labels:  url, uri
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
Bidi
Bidirectional URI routing
Stars: ✭ 941 (+523.18%)
Mutual labels:  url, uri
Universal Url
WHATWG URL for Node & Browser.
Stars: ✭ 20 (-86.75%)
Mutual labels:  url, url-parsing
Libvmod Querystring
Query-string module for Varnish Cache
Stars: ✭ 85 (-43.71%)
Mutual labels:  url, url-parsing
ocaml-uri
RFC3986 URI parsing library for OCaml
Stars: ✭ 85 (-43.71%)
Mutual labels:  url, uri
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
Uri
🌏 Functions for making sense out of URIs in PHP
Stars: ✭ 259 (+71.52%)
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
Urlshorting
A simple but powerful URL shortener
Stars: ✭ 150 (-0.66%)
Mutual labels:  url, domain
url-normalize
URL normalization for Python
Stars: ✭ 82 (-45.7%)
Mutual labels:  url, uri
Kit-UrlParser
RFC 3986 compliant url parsing library with PSR-7 Uri component
Stars: ✭ 31 (-79.47%)
Mutual labels:  uri, url-parsing
Uri.js
Javascript URL mutation library
Stars: ✭ 6,119 (+3952.32%)
Mutual labels:  url, uri

tldts - Blazing Fast URL Parsing

NPM

Build Status Known Vulnerabilities

tldts is a JavaScript library to extract hostnames, domains, public suffixes, top-level domains and subdomains from URLs.

Features:

  1. Tuned for performance (order of 0.1 to 1 μs per input)
  2. Handles both URLs and hostnames
  3. Full Unicode/IDNA support
  4. Support parsing email addresses
  5. Detect IPv4 and IPv6 addresses
  6. Continuously updated version of the public suffix list
  7. TypeScript, ships with umd, esm, cjs bundles and type definitions
  8. Small bundles and small memory footprint
  9. 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

MIT 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].