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'