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:
dev-313 authored and Myles Borins committed 2019-12-17 18:17:18 -05:00
1 parent 0d2172fb5d
commit b53e2a84ec
1 file changed
+1 -1
+1 -1
View File
@@ -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'