What is backpressure in streams?

Node.js modules, files and async · Experienced

Model answer

Backpressure happens when a writable stream cannot consume data as fast as the readable produces it. write() returns false to signal "slow down", and the producer should wait for the 'drain' event. pipe() and stream.pipeline handle this for you, which prevents memory from growing without limit.

Learn this topic

Async JavaScript in Node: Promises, async/await and the Event Loop in the course Node.js and Express: Build a Back End API from Scratch.

Sign in to add your own answer.

More questions