isbn-bisac-tools
Version:
A toolkit for working with BISAC subject headings and ISBN lookups
50 lines (49 loc) • 1.75 kB
TypeScript
/**
* ISBN-BISAC Tools - Utilities for working with BISAC codes and ISBN lookups
*
* This package provides tools for scraping BISAC Subject Headings from bisg.org,
* converting ISBNs to BISAC codes, and various utilities for managing BISAC data.
*/
import { Page } from 'puppeteer';
import { ScraperConfig, Category } from './types/index.js';
declare const CATEGORY_URLS: string[];
declare const CONFIG: ScraperConfig;
/**
* Process a single category page and extract its data
* @param page - Puppeteer page object
* @param url - URL of the category page
* @returns Extracted category data
*/
declare function processCategoryPage(page: Page, url: string, currentIndex: number, totalUrls: number): Promise<Category>;
/**
* Main scraping function
* @param singleCategoryUrl - Optional URL for scraping a single category
*/
declare function scrape(singleCategoryUrl?: string, customConfig?: ScraperConfig, browseMode?: boolean, isTestMode?: boolean): Promise<Category[]>;
/**
* Parse command line arguments
* @returns Object containing parsed command line arguments
*/
declare function parseCommandLineArgs(): {
categoryUrl?: string;
shouldShowHelp: boolean;
code?: string;
heading?: string;
label?: string;
isbn?: string;
lookupMode: boolean;
enableScreenshots: boolean;
compare: boolean;
scrape: boolean;
};
/**
* Display help information
*/
declare function showHelp(): void;
/**
* Extract all category URLs from the main page
* @param page - Puppeteer page object
* @returns Array of category URLs
*/
declare function extractCategoryUrls(page: Page): Promise<string[]>;
export { scrape, processCategoryPage, extractCategoryUrls, parseCommandLineArgs, showHelp, CONFIG, CATEGORY_URLS, };