Node-only helpers (@sloppyvoice/sdk/node): a TXT resolver on node:dns/promises for native discovery (02 §3.5, §5.2) and a Public Suffix List loader (02 §9.3). Also works on Deno and Bun, which provide node:dns and node:fs. Node modules are imported dynamically so that this module can be bundled without pulling them into browser builds.

import { … } from '@sloppyvoice/sdk/node'

Functions

loadPublicSuffixList function

function loadPublicSuffixList(path: string): Promise<PublicSuffixList>

Load a Public Suffix List file (public_suffix_list.dat, https://publicsuffix.org/list/) from disk for same-site evidence (02 §9.1). Servers SHOULD refresh it at least every 30 days and MUST NOT use a copy older than 180 days (02 §9.3); this function doesn't check the file's age.

path: string

Source: node/index.ts:116

mapNodeDnsError function

function mapNodeDnsError(code: string | undefined, message?: string): TxtLookupResult

Map a node:dns error code to a lookup result (02 §3.4).

code: string | undefined
message?: string

Source: node/index.ts:29

nodeTxtResolver function

function nodeTxtResolver(options?: NodeTxtResolverOptions): TxtResolver

A TxtResolver backed by node:dns/promises (c-ares): one TXT query, recursion desired, 5 s per attempt, 2 attempts (02 §3.5). NXDOMAIN and NODATA are "no record"; SERVFAIL, REFUSED, timeouts and other errors are temporary DNS failures (02 §3.4).

Limits of this backend: resolveTxt doesn't expose TTLs or DNSSEC status, so delegations are cached for the 300 s minimum of 02 §13.1 and never get dnssec evidence; the negative TTL of NXDOMAIN isn't known either, so the 300 s default of 02 §13.3 applies.

options: NodeTxtResolverOptions

Default: {}

Source: node/index.ts:56

Interfaces

NodeTxtResolverOptions interface

Options of nodeTxtResolver.

interface NodeTxtResolverOptions

servers?

servers?: string[]

DNS servers (host or host:port). Default: the system configuration. A server SHOULD use a validating resolver it trusts (02 §3.5, §15.2); this resolver never reports DNSSEC validation, so it never yields dnssec evidence.

timeoutMs?

timeoutMs?: number

Per-attempt timeout (02 §3.5: 5 s).

tries?

tries?: number

Attempts (02 §3.5: at most 2).

Source: node/index.ts:15