G-code Preview — API Reference
    Preparing search index...

    Interface BgcodeDecodeOptions

    interface BgcodeDecodeOptions {
        maxOutputBytes?: number;
        metadata?: boolean;
    }
    Index
    maxOutputBytes?: number

    Hard cap on total decoded G-code bytes — decompression-bomb defense (default 512 MiB). Must be a non-negative safe integer; anything else (NaN, Infinity, negative, fractional, non-number) throws E_BGCODE_OPTION before any decoding.

    metadata?: boolean

    Also decode the metadata (INI) + thumbnail blocks into settings/thumbnails (default false). These blocks share a fixed 32 MiB internal budget, separate from maxOutputBytes; a file whose metadata + thumbnails exceed it fails with E_BGCODE_BOMB.