From be4fffe396ddc138970d7904da23ca5d7a1c0a13 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 4638c175a629ab..321e45b47b6b4f 100644 --- a/doc/api/stream.md +++ b/doc/api/stream.md @@ -294,10 +294,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'`