es6-crawler-detect
Version:
This is an ES6 adaptation of the original PHP library CrawlerDetect, this library will help you detect bots/crawlers/spiders vie the useragent.
21 lines • 708 B
TypeScript
import { Request } from 'express-serve-static-core';
import { IncomingHttpHeaders } from 'http2';
export declare class Crawler {
private crawlers;
private headers;
private exclusions;
private request;
private compiledRegexList;
private compiledExclusions;
private httpHeaders;
private userAgent;
private matches?;
constructor(request?: Request, headers?: IncomingHttpHeaders, userAgent?: string);
compileRegex(patterns: string[], flags?: string): RegExp;
private setHttpHeaders;
private setUserAgent;
private getUaHttpHeaders;
getMatches(): string | null | object;
isCrawler(userAgent?: string): boolean;
}
//# sourceMappingURL=crawler.d.ts.map