Creates a ReadableStream from Binary file, that actually waits until the reading operator has caught up before it pushes more.

Constructors

Methods

  • the more elegant way to parse saves, instead of using the plain ParseSave. Since streaming will not hold the converted JSON in memory at once.

    Parameters

    • name: string

      the save name

    • bytes: ArrayBufferLike

      the save file as UInt8Array

    • Optionaloptions: Partial<{
          onDecompressedSaveBody: ((buffer: ArrayBufferLike) => void);
          onProgress: ((progress: number, message?: string) => void);
      }>

    Returns {
        startStreaming: (() => Promise<void>);
        stream: ReadableStream<string>;
    }

    a WHATWG compliant readable stream of strings (They are valid JSON and represent a SatisfactorySave object). And a method to actually start the streaming for more precise control.

    • startStreaming: (() => Promise<void>)
        • (): Promise<void>
        • Returns Promise<void>

    • stream: ReadableStream<string>