Skip to content

Commit 1d918b6

Browse files
Trottcodebytere
authored andcommitted
doc,stream: split finish and end events into separate entries
The stream doc has the only instance in our docs where two events are combined into a single entry. Split them into separate adjacent entries. PR-URL: #33881 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Robert Nagy <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent f66bb57 commit 1d918b6

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

doc/api/stream.md

+11-7
Original file line numberDiff line numberDiff line change
@@ -2579,15 +2579,19 @@ const myTransform = new Transform({
25792579
});
25802580
```
25812581

2582-
#### Events: `'finish'` and `'end'`
2582+
#### Event: `'end'`
25832583

2584-
The [`'finish'`][] and [`'end'`][] events are from the `stream.Writable`
2585-
and `stream.Readable` classes, respectively. The `'finish'` event is emitted
2586-
after [`stream.end()`][stream-end] is called and all chunks have been processed
2587-
by [`stream._transform()`][stream-_transform]. The `'end'` event is emitted
2588-
after all data has been output, which occurs after the callback in
2584+
The [`'end'`][] event is from the `stream.Readable` class. The `'end'` event is
2585+
emitted after all data has been output, which occurs after the callback in
25892586
[`transform._flush()`][stream-_flush] has been called. In the case of an error,
2590-
neither `'finish'` nor `'end'` should be emitted.
2587+
`'end'` should not be emitted.
2588+
2589+
#### Event: `'finish'`
2590+
2591+
The [`'finish'`][] event is from the `stream.Writable` class. The `'finish'`
2592+
event is emitted after [`stream.end()`][stream-end] is called and all chunks
2593+
have been processed by [`stream._transform()`][stream-_transform]. In the case
2594+
of an error, `'finish'` should not be emitted.
25912595

25922596
#### `transform._flush(callback)`
25932597

0 commit comments

Comments
 (0)