@happy-ts/fetch-t
    Preparing search index...

    Interface FetchProgress

    Represents the download progress of a fetch operation.

    Passed to the onProgress callback when tracking download progress. Note: Progress tracking requires the server to send a Content-Length header.

    import { fetchT, type FetchProgress } from '@happy-ts/fetch-t';

    await fetchT('https://example.com/file.zip', {
    responseType: 'blob',
    onProgress: (result) => {
    result.inspect((progress: FetchProgress) => {
    const percent = (progress.completedByteLength / progress.totalByteLength) * 100;
    console.log(`Downloaded: ${percent.toFixed(1)}%`);
    });
    },
    });
    interface FetchProgress {
        completedByteLength: number;
        totalByteLength: number;
    }
    Index

    Properties

    completedByteLength: number

    The number of bytes received so far.

    totalByteLength: number

    The total number of bytes to be received (from Content-Length header).