Skip to content

Commit

Permalink
tty: make setRawMode() return this (and updated corresponding docs)
Browse files Browse the repository at this point in the history
  • Loading branch information
ORESoftware committed Sep 19, 2018
1 parent ed35df7 commit 6925bad
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion doc/api/tty.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ added: v0.7.7
* `mode` {boolean} If `true`, configures the `tty.ReadStream` to operate as a
raw device. If `false`, configures the `tty.ReadStream` to operate in its
default mode. The `readStream.isRaw` property will be set to the resulting
mode.
mode. Returns `this` - the read stream instance.

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

Expand Down
3 changes: 2 additions & 1 deletion lib/tty.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,10 @@ ReadStream.prototype.setRawMode = function(flag) {
const err = this._handle.setRawMode(flag);
if (err) {
this.emit('error', errors.errnoException(err, 'setRawMode'));
return;
return this;
}
this.isRaw = flag;
return this;
};

function WriteStream(fd) {
Expand Down

0 comments on commit 6925bad

Please sign in to comment.