Skip to content

NetstringDecodeStreamOptions

NetstringDecodeStreamOptions = NetstringDecoderOptions & object

Defined in: packages/format-netstring/src/netstring/netstring-decoder.ts:127

optional maxBufferSize?: number

Hard ceiling on undecoded retained bytes. Distinct from NetstringDecoderOptions.maxPayloadLength, which bounds one declared frame; this bounds how much a producer may hand over before any of it is decodable. Defaults to 1 MiB.

optional onProtocolError?: (error) => void

Invoked for a recoverable protocol violation. Decoding continues afterward — the Streams Standard has no event for a transform stream to report an error without closing, so this callback is the substitute for the 'error'-without-destroy() pattern a Node.js Transform would use.

unknown

void