pyseoa-ts
v0.2.0
Published
SEO analysis tools for the web, ported from pyseoa (Python) to TypeScript
Downloads
17
Maintainers
Readme
pyseoa-ts
TypeScript SEO audit library for frontend and microservice use – crawl, analyze, and track progress in real time.
✨ Features
- Full or single-page SEO audits
- Real-time progress via callback
- Crawl with depth & page limits
- Rate limiting (delay between requests)
- Custom User-Agent support
- Clean typed output for easy integration
📦 Installation
npm install pyseoa-ts🚀 Quick Usage
import { runSeoAudit } from "pyseoa-ts";
const summary = await runSeoAudit("https://example.com", {
crawl: true,
delayMs: 500,
userAgent: "MySEOAuditBot/1.0",
}, (progress) => {
console.log(`[${progress.pageIndex}] ${progress.type.toUpperCase()} ${progress.stage}: ${progress.url}`);
});🛠 API
runSeoAudit(url: string, options?: RunSeoAuditOptions, onProgress?: (progress: AuditProgress) => void): Promise<AuditSummary>
Audit a single page or entire site (if crawl: true).
Options:
type RunSeoAuditOptions = {
crawl?: boolean;
maxPages?: number;
maxDepth?: number;
delayMs?: number; // Delay (ms) between pages when crawling
userAgent?: string; // Custom User-Agent string
}Progress Events:
type AuditProgress = {
type: "crawl" | "analyze"; // Type of progress
url: string; // Current URL
pageIndex: number; // Index of page in crawl
stage: "fetch" | "skip" | "analyze"; // Progress stage
}📤 Exports
// Functions
export { runAnalysis, runSeoAudit };
// Types
export type {
AuditSummary,
PageAnalysisResult,
AnalysisResult,
TitleResult,
MetaDescriptionResult,
H1Result,
CanonicalResult,
RobotsResult,
KeywordsResult,
OpenGraphResult,
TwitterCardResult,
KeywordDensityResult,
AuditProgress
} from "pyseoa-ts";📚 License
MIT
Made by masem - Mario Semper
