mirror of
https://github.com/nodejs/node.git
synced 2026-11-24 21:50:36 -05:00
doc: improve doc writable streams: 'finish' event
doc change for stream.md that 'finish' event should be before writer.end fixes: https://github.com/nodejs/node/issues/30759 PR-URL: https://github.com/nodejs/node/pull/30889 Fixes: https://github.com/nodejs/node/issues/30759 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Rich Trott <rtrott@gmail.com>
This commit is contained in:
1 parent
0d2172fb5d
commit
b53e2a84ec
1 file changed
+1
-1
+1
-1
@@ -297,10 +297,10 @@ const writer = getWritableStreamSomehow();
|
||||
for (let i = 0; i < 100; i++) {
|
||||
writer.write(`hello, #${i}!\n`);
|
||||
}
|
||||
writer.end('This is the end\n');
|
||||
writer.on('finish', () => {
|
||||
console.log('All writes are now complete.');
|
||||
});
|
||||
writer.end('This is the end\n');
|
||||
```
|
||||
|
||||
##### Event: 'pipe'
|
||||
|
||||
Reference in new issue
Block a user