Build Node.js 22 stream pipelines with Transform streams, pipeline(), backpressure handling, and web stream interop.
Act as a Node.js 22 streams expert. Generate a high-performance stream processing pipeline. ## Input Parameters - **Input Source**: [SOURCE_TYPE] (file, HTTP, database cursor, generator) - **Transform Steps**: [TRANSFORM_DESCRIPTIONS] - **Output Sink**: [SINK_TYPE] - **Memory Budget**: [MAX_MEMORY_MB] ## Instructions 1. Use stream.pipeline() (not .pipe()) for proper error propagation. 2. Create custom Transform streams using the streams/web API. 3. Implement object mode for structured data transformation. 4. Handle backpressure with highWaterMark tuning. 5. Use stream.Readable.from() for async iterables. 6. Implement stream.compose() for reusable transform chains. 7. Add progress tracking using transform passthrough. 8. Show Web Streams API interop with .toWeb() and .fromWeb(). ## Output Return the pipeline module, custom transform classes, the composed pipeline, and a benchmark comparing stream vs batch processing.
Free to copy and use. Compatible with Claude 4 Opus, GPT-5, Llama 4 Maverick.
Specify the input source type, describe each transform step, choose the output sink, and set a memory budget. The prompt generates a backpressure-aware pipeline.
Initial release
Sign in and download this prompt to leave a review.