UNPKG

url-metadata

Version:

Request a url and scrape the metadata from its HTML using Node.js or the browser.

24 lines (21 loc) 714 B
export = urlMetadata declare function urlMetadata( url: string | null, options?: urlMetadata.Options, ): Promise<urlMetadata.Result> declare namespace urlMetadata { interface Options { requestHeaders?: Record<string, string>; requestFilteringAgentOptions?: import('request-filtering-agent').RequestFilteringAgentOptions; cache?: string; mode?: string; maxRedirects?: number; timeout?: number; decode?: string; descriptionLength?: number; ensureSecureImageRequest?: boolean; includeResponseBody?: boolean; parseResponseObject?: globalThis.Response | import('node-fetch').Response; } type Result = Record<string, string | boolean | undefined | any | any[]>; }