We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3fda730 commit f1d486aCopy full SHA for f1d486a
1 file changed
doc/api/stream.md
@@ -2650,10 +2650,10 @@ const writable = fs.createWriteStream('./file');
2650
async function pump(iterable, writable) {
2651
for await (const chunk of iterable) {
2652
// Handle backpressure on write().
2653
- if (writable.destroyed) return;
2654
- if (!writable.write(chunk)) {}
+ if (!writable.write(chunk)) {
+ if (writable.destroyed) return;
2655
await once(writable, 'drain');
2656
+ }
2657
}
2658
writable.end();
2659
0 commit comments