UNPKG

discord-guildpeek

Version:

Get a public preview of a Discord server from its invite code, without authentication.

12 lines (11 loc) 592 B
/** * Checks if a resource at the specified URL is available by making a HEAD request. * * @param url - The URL of the resource to check. * @returns A promise that resolves to `true` if the resource is available (HTTP status 200-299), or `false` otherwise. * * @remarks * This function uses the Fetch API to perform a HEAD request, which retrieves only the headers and not the full content. * If the request fails due to network issues or an invalid URL, the function logs the error and returns `false`. */ export declare function isResourceAvailable(url: string): Promise<boolean>;