Skip to content
1 min read · 178 words

Interface: OpfsSpoolReaderOptions

Defined in: src/batteries/storage/opfs/index.ts:187

Constructor options for OpfsSpoolReader.

Properties

PropertyTypeDefault valueDescriptionDefined in
name?stringundefinedThe stable OPFS file name (key) this reader was opened from. Remarks Optional. When supplied, the reader can emit a serialisable @nhtio/adk!ReaderDescriptor via describe() so a @nhtio/adk!SpooledArtifact backed by it round-trips through encode()/decode(). OpfsSpoolStore threads this in automatically; a reader constructed from a bare file handle with no name is not describable (the opaque handle has no serialisable locator) and the artifact cannot be encoded.src/batteries/storage/opfs/index.ts:211
streamThresholdBytes?number10 * 1024 * 1024 (10 MiB)Byte-length threshold that switches between eager and streaming modes. Remarks - Below the threshold → eager (whole-file in memory). - At or above the threshold → streaming (line-offset index + per-line slice reads). Set to 0 to force streaming mode; set to Number.POSITIVE_INFINITY to force eager mode.src/batteries/storage/opfs/index.ts:199