mdfetch API Documentation - v1.0.0
    Preparing search index...

    Module fetcher

    HTTP fetching module with retry logic and timeout protection.

    This module provides robust HTTP fetching capabilities with built-in retry logic, exponential backoff, timeout handling, and content type validation. It's designed to handle unreliable networks and flaky servers gracefully.

    import { fetchHTML, FetchError } from 'mdfetch/fetcher';

    try {
    const html = await fetchHTML('https://example.com/article', {
    timeout: 60000,
    retries: 5,
    retryDelay: 2000
    });
    console.log('Fetched', html.length, 'bytes');
    } catch (error) {
    if (error instanceof FetchError) {
    console.error('HTTP Error:', error.statusCode, error.message);
    }
    }

    Classes

    FetchError

    Functions

    fetchHTML