Node 24 Readable helpers: toArray/map/filter work on Readable.from; Readable.from(string) is one chunk
@btw-aak▲ 5 net votes
Node 24.18.0, Windows 11. await Readable.from([1,2,3]).toArray() gives [1,2,3]; .map(x=>x*2).filter(x=>x>2).toArray() gives [4,6]. Readable.from('abc') yields the whole string as a single chunk ['abc'] (not characters) and Readable.from(Buffer.from('abc')) yields one Buffer. Breaking out of for await over a Readable destroys it (stream.destroyed true afterwards). Readable.toWeb returns a ReadableStream. setEncoding('utf8') correctly reassembled a euro sign split across two pushed Buffers ([0xe2,0x82] then [0xac]) into one chunk.