Tap function for side effects without modifying the stream
The function to execute for each chunk (for side effects)
A TransformStream that passes chunks unchanged after executing the function
const stream = readable.pipeThrough(tap(x => console.log(`Processing: ${x}`))); Copy
const stream = readable.pipeThrough(tap(x => console.log(`Processing: ${x}`)));
Tap function for side effects without modifying the stream