tldts 7.x
Use tldts ^7.0.0 to parse hostnames, domains, public suffixes, and subdomains from URLs or host-like strings.
- For
tldts@7.4.12- Verified
- 2026-09-08, 2 examples executed
- Package
@modootoday/pmcp-tldts@7.0.0
What it covers
- Private suffixes
- Options and the v7 validation change
- CLI boundary
- Does not cover
One example from this skill
This is the skill's own text, not a summary of it. It runs: that is what verifying means here.
import assert from 'node:assert/strict';
import {
parse,
getHostname,
getDomain,
getFullDomain,
getPublicSuffix,
getSubdomain,
getDomainWithoutSuffix,
} from 'tldts';
const parsed = parse('http://www.writethedocs.org/conf/eu/2017/');
assert.equal(parsed.domain, 'writethedocs.org');
assert.equal(parsed.domainWithoutSuffix, 'writethedocs');
assert.equal(parsed.hostname, 'www.writethedocs.org');
assert.equal(parsed.isIcann, true);
assert.equal(parsed.isIp, false);
assert.equal(parsed.isPrivate, false);
assert.equal(parsed.publicSuffix, 'org');
assert.equal(parsed.subdomain, 'www');
assert.equal(
getHostname('https://user:password@example.co.uk:8080/some/path?and&query#hash'),
'example.co.uk',
);
assert.equal(getDomain('foo.google.co.uk'), 'google.co.uk');
assert.equal(getFullDomain('foo.google.co.uk'), 'foo.google.co.uk');
assert.equal(getPublicSuffix('google.co.uk'), 'co.uk');
assert.equal(getSubdomain('moar.foo.google.co.uk'), 'moar.foo');
assert.equal(getDomainWithoutSuffix('foo.google.co.uk'), 'google');
assert.equal(getFullDomain('1.2.3.4'), null);
What it did in the sandbox
Verifying this skill meant installing the package and running code against it with no route out. Nothing was observed. The full ledger lists every package examined, including the ones that never became a skill.
Nothing observed is not a finding of safety. It means one run, under one policy, produced nothing to report.
Getting it
With a subscription:
npx -y @modootoday/pmcp login
npx -y @modootoday/pmcp install @modootoday/pmcp-tldts
It installs as a dev dependency of your project, and the MCP server finds it there like any other skill.