UNPKG

@avenga/linkinator

Version:

Find broken links, missing images, etc in your HTML. Scurry around your site and find all those broken links.

56 lines (55 loc) 1.63 kB
export type SharedOptions = { concurrency?: number; recurse?: boolean; timeout?: number; markdown?: boolean; serverRoot?: string; directoryListing?: boolean; retry?: boolean; retryNoHeader?: boolean; retryNoHeaderCount?: number; retryNoHeaderDelay?: number; retryErrors?: boolean; retryErrorsCount?: number; retryErrorsJitter?: number; extraHeaders?: { [key: string]: string; }; userAgent?: string; bodyRegex?: string; }; export type UrlRewriteExpression = { pattern: RegExp; replacement: string; }; export type CheckOptions = SharedOptions & { path: string | string[]; port?: number; linksToSkip?: string[] | ((link: string) => Promise<boolean>); urlRewriteExpressions?: UrlRewriteExpression[]; }; export declare const DEFAULT_OPTIONS: { concurrency: number; directoryListing: false; extraHeaders: {}; retry: false; retryErrors: false; retryErrorsCount: number; retryErrorsJitter: number; retryNoHeader: false; retryNoHeaderCount: number; retryNoHeaderDelay: number; timeout: number; userAgent: string; }; type DefaultKeys = keyof typeof DEFAULT_OPTIONS; export type InternalCheckOptions = { syntheticServerRoot?: string; staticHttpServerHost?: string; } & Omit<CheckOptions, DefaultKeys> & Required<Pick<CheckOptions, DefaultKeys>>; /** * Validate the provided flags all work with each other. * @param options CheckOptions passed in from the CLI (or API) */ export declare function processOptions(options_: CheckOptions): Promise<InternalCheckOptions>; export {};