Skip to content

Commit 6925bad

Browse files
committed
tty: make setRawMode() return this (and updated corresponding docs)
1 parent ed35df7 commit 6925bad

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

doc/api/tty.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ added: v0.7.7
6363
* `mode` {boolean} If `true`, configures the `tty.ReadStream` to operate as a
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
66-
mode.
66+
mode. Returns `this` - the read stream instance.
6767

6868
Allows configuration of `tty.ReadStream` so that it operates as a raw device.
6969

lib/tty.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,10 @@ ReadStream.prototype.setRawMode = function(flag) {
7171
const err = this._handle.setRawMode(flag);
7272
if (err) {
7373
this.emit('error', errors.errnoException(err, 'setRawMode'));
74-
return;
74+
return this;
7575
}
7676
this.isRaw = flag;
77+
return this;
7778
};
7879

7980
function WriteStream(fd) {

0 commit comments

Comments
 (0)