Skip to content

Commit 690deaa

Browse files
dev-scripttargos
authored andcommitted
doc: improve doc writable streams: 'finish' event
doc change for stream.md that 'finish' event should be before writer.end fixes: #30759 PR-URL: #30889 Fixes: #30759 Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Rich Trott <[email protected]>
1 parent 2f4615c commit 690deaa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

doc/api/stream.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -294,10 +294,10 @@ const writer = getWritableStreamSomehow();
294294
for (let i = 0; i < 100; i++) {
295295
writer.write(`hello, #${i}!\n`);
296296
}
297-
writer.end('This is the end\n');
298297
writer.on('finish', () => {
299298
console.log('All writes are now complete.');
300299
});
300+
writer.end('This is the end\n');
301301
```
302302

303303
##### Event: `'pipe'`

0 commit comments

Comments
 (0)