Skip to content

Commit 19851f8

Browse files
mattprbengl
authored andcommitted
doc: readline 'line' event emits final line
Updated docs to reflect current behaviour of readline: final line of input will be emitted via `'line'` event when input stream `'end'` event is emitted even when the input is not newline terminated. Refs: nodejs/node-v0.x-archive#7238 PR-URL: #42214 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
1 parent 62d9a7f commit 19851f8

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

doc/api/readline.md

+3
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,9 @@ The `'line'` event is emitted whenever the `input` stream receives an
111111
end-of-line input (`\n`, `\r`, or `\r\n`). This usually occurs when the user
112112
presses <kbd>Enter</kbd> or <kbd>Return</kbd>.
113113

114+
The `'line'` event is also emitted if new data has been read from a stream and
115+
that stream ends without a final end-of-line marker.
116+
114117
The listener function is called with a string containing the single line of
115118
received input.
116119

0 commit comments

Comments
 (0)