API · Low level

writeData()

Write a value unconditionally as data, even when it is an `Error` or Exstream control-like value.

Signature

writeData(value: T): boolean

Example

const source = exstream()
source.writeData(new Error('this is payload'))
source.end()

Behavior

Unlike write(), this method bypasses Error classification. The value enters the ordinary data path and callbacks receive it as data. It has the same boolean backpressure contract, buffering limits, overflow policies, and post-end rejection as write().

Prefer writeData(error) or write(exstream.data(error)) when Error objects are part of the domain model. Do not use it to disguise operational failures that should enter Exstream’s error protocol.

Forms

writeData() is instance-only.

write(), errors(), end()