Permalink
Browse files

tty: refactor exports

This commit moves the tty module's exports to a single object,
which is more aligned with other core modules.

PR-URL: #16959
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
  • Loading branch information...
cjihrig authored and gibfahn committed Nov 12, 2017
1 parent 1136741 commit d17607351153b6f7639e41e8b286ceadfc4fe66d
Showing with 5 additions and 6 deletions.
  1. +5 −6 lib/tty.js
View
@@ -8,10 +8,9 @@ const inherits = util.inherits;
const errnoException = util._errnoException;
const readline = require('readline');
exports.isatty = function(fd) {
function isatty(fd) {
return Number.isInteger(fd) && fd >= 0 && isTTY(fd);
};
}
function ReadStream(fd, options) {
@@ -32,8 +31,6 @@ function ReadStream(fd, options) {
}
inherits(ReadStream, net.Socket);
exports.ReadStream = ReadStream;
ReadStream.prototype.setRawMode = function(flag) {
flag = !!flag;
this._handle.setRawMode(flag);
@@ -64,7 +61,6 @@ function WriteStream(fd) {
}
}
inherits(WriteStream, net.Socket);
exports.WriteStream = WriteStream;
WriteStream.prototype.isTTY = true;
@@ -105,3 +101,6 @@ WriteStream.prototype.clearScreenDown = function() {
WriteStream.prototype.getWindowSize = function() {
return [this.columns, this.rows];
};
module.exports = { isatty, ReadStream, WriteStream };

0 comments on commit d176073

Please sign in to comment.