JavaScript Library to extract domains, subdomains and public suffixes from complex URIs.
MIT License
Bot releases are hidden (Show)
Published by remusao about 5 years ago
New optimizations #255
parse(...)
indexOf
and lastIndexOf
in packed hashThese optimizations result in up to 20% faster invocations of parse(...)
and 40% faster invocations of getPublicSuffix(...)
when using
tldts-experimental
. This should also reduce memory pressure in cases where
specific methods are used (i.e.: all but parse(...)
) since no intermediary
result object needs to be allocated.
Published by remusao about 5 years ago
Published by remusao over 5 years ago
extractHostname
: will now avoid lower-casing the result in some casesextractHostname
: handles single or triple '/' after protocolextractHostname
: has fast-path for validation of common protocols (e.g. https)isProbablyIpv4
: performs first quick check on length of hostnameisProbablyIpv6
: performs first quick check on length of hostnameisValidHostname
: make use of charCodeAt
instead of codePointAt
lookupInTrie
: makes use of Trie with more stable structure (faster)lookupInTrie
: lazily allocate memory for resultsuffixLookup
: uses fast-path for most common suffixes (massive speed-up)suffixLookup
: does not allocate memory for result anymoresetDefaults
: fast-path in case no argument was providedgetSubdomain
: fast-path if subdomain is emptydetectIp
allows to disable IP checkmixedInput
allows to specify if we expect a mix of URLs and hostnames asextractHostname
can be set tofalse
to speed-up parsing. If only URLs are expected then mixedInputs
false
. The mixedInputs
is only a hint and will notvalidateHostname
can be set to false
to disable validation andbin/
folder to TypeScripttldts
cli which can be used to parse URLsPublished by remusao over 5 years ago
Published by remusao almost 6 years ago
This Release introduces some more optimizations both in size of bundles,
memory usage and speed of parsing. Because it introduces some breaking
changes in the API results (host
renamed into hostname
and deletion
of the isValid
attribute), as well as introducing a new experimental
backend (tldts-experimental
bundle), this is a major version bump.
#16 Optimizations + comparison with other libraries (#16)
#13 Implement experimental probabilistic packed suffix structure (#13)
Published by remusao almost 6 years ago