Skip to content

Commit 9c36827

Browse files
ORESoftwaretargos
authored andcommitted
tty: make readStream.setRawMode() return this
PR-URL: #22950 Fixes: #22916 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Denys Otrishko <[email protected]>
1 parent 43e3cf9 commit 9c36827

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

doc/api/tty.md

+1
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ added: v0.7.7
6464
raw device. If `false`, configures the `tty.ReadStream` to operate in its
6565
default mode. The `readStream.isRaw` property will be set to the resulting
6666
mode.
67+
* Returns: {this} - the read stream instance.
6768

6869
Allows configuration of `tty.ReadStream` so that it operates as a raw device.
6970

lib/tty.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,10 @@ ReadStream.prototype.setRawMode = function(flag) {
6666
const err = this._handle.setRawMode(flag);
6767
if (err) {
6868
this.emit('error', errors.errnoException(err, 'setRawMode'));
69-
return;
69+
return this;
7070
}
7171
this.isRaw = flag;
72+
return this;
7273
};
7374

7475
function WriteStream(fd) {

0 commit comments

Comments
 (0)