From 08728a1177d4d310b21097d94e33312026eb72b2 Mon Sep 17 00:00:00 2001 From: dev-313 Date: Tue, 10 Dec 2019 23:17:39 +0530 Subject: [PATCH] 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 Reviewed-By: Rich Trott --- doc/api/stream.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/api/stream.md b/doc/api/stream.md index 4e3efde0752261..a880bae5bbe31d 100644 --- a/doc/api/stream.md +++ b/doc/api/stream.md @@ -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'