link-checker-cli
Version:
CLI tool to check for broken links in a website or project
44 lines (43 loc) • 951 B
TypeScript
export type LinkCheckResult = {
isValid: boolean;
link: string;
statusCode: number;
parent?: string;
message?: string;
cached?: boolean;
};
export type Options = {
source: string;
image: boolean;
external: boolean;
userAgent: string | undefined;
concurrencySize: number;
};
export type SiteOption = Options & {
recursive: boolean;
style: boolean;
};
export type SitemapOptions = {
source: string;
userAgent: string | undefined;
concurrencySize: number;
};
export type LinkType = "internal" | "external" | "style" | "image" | "anchor";
export type Link = {
type: LinkType;
value: string;
parent: string;
};
export type ParsePageResult = {
links: Link[];
ids: [];
};
export type PromisePoolOptions<T, R> = {
items: T[];
concurrency: number;
handler: (item: T) => Promise<R>;
};
export type PromisePoolResult<T> = {
results: T[];
errors: Error[];
};