JSR

getNodeInfo(

url: URL | string,

options?: GetNodeInfoOptions & { parse?: "strict" | "best-effort"; }

): Promise<NodeInfo | undefined>

Fetches a NodeInfo document from the given URL.

Parameters

The base URL of the server. If options.direct is turned off (default), the NodeInfo document will be fetched from the .well-known location of this URL (hence the only origin of the URL is used). If options.direct is turned on, the NodeInfo document will be fetched from the given URL.

Options for fetching the NodeInfo document.

Return Type

The NodeInfo document if it could be fetched successfully. Otherwise, undefined is returned.

getNodeInfo(

url: URL | string,

options: GetNodeInfoOptions & { parse: "none"; }

): Promise<JsonValue | undefined>

Fetches a NodeInfo document from the given URL.

Parameters

The base URL of the server. If options.direct is turned off (default), the NodeInfo document will be fetched from the .well-known location of this URL (hence the only origin of the URL is used). If options.direct is turned on, the NodeInfo document will be fetched from the given URL.

Options for fetching the NodeInfo document.

Return Type

The NodeInfo document if it could be fetched successfully. Otherwise, undefined is returned.

Read the original on jsr.io ↗