tldts
Installation
SKILL.md
tldts
Use this skill for tldts v7 hostname and domain extraction backed by the Public Suffix List (PSL). Snapshot 7.4.18 (2026-10). MIT license. Ships ESM, CJS, UMD, and types.
Workflow
- Inspect the local surface:
- Package:
tldts(ICANN + private PSL sections),tldts-icann(ICANN section only, smaller), ortldts-experimental(packed hash lookup, same API). - Version: prefer 7.x.
getFullDomainanddetectSpecialUse/isSpecialUseare recent 7.x additions; check the installed version before using them. - Input shape: full URLs, bare hostnames, emails, or a mix. This drives the options.
- Package:
- Pick the narrowest function. Single-purpose getters are faster than
parseand do not allocate a result object. - Decide the PSL section on purpose.
allowPrivateDomainsdefaults tofalse, soa.b.github.iogives domaingithub.io. For cookie scope, same-site, or tenant isolation on shared hosts, setallowPrivateDomains: true. - Route detail:
- Full API, result fields, options, CLI, package variants: api-options.md
- Verified edge cases, security traps, migrations: pitfalls.md
- Prefer
bun/bunxin command examples. Match the project's import style (import { getDomain } from 'tldts'orrequire).