INNER CODE UNIT · TypeScript
createOPFSTempStream
gildas-lormeau/zip.js · index.d.ts:774
export function createOPFSTempStream(options?: OPFSTempStreamOptions): () => Promise<TempStream>;
/**
* Options for {@link createBlobTempStream}.
*/
export interface BlobTempStreamOptions {
/**
* Spill a buffered entry to a `Blob` once its buffered data exceeds this size, in bytes. Smaller entries stay in memory.
*
* @defaultValue 1048576
*/
thresholdBytes?: number;
}
/**
* Builds a {@link ZipWriterConstructorOptions.createTempStream} factory that spills the data of buffered entries into a `Blob` instead of keeping it in memory.
*
* An entry stays in memory until it exceeds `thresholdBytes`, then its data is transferred incrementally into a `Blob` built with `new Response(stream).blob()` and streamed back afterwards.