Skip to content

Commit d176073

Browse files
cjihriggibfahn
authored andcommitted
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>
1 parent 1136741 commit d176073

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

lib/tty.js

+5-6
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,9 @@ const inherits = util.inherits;
88
const errnoException = util._errnoException;
99
const readline = require('readline');
1010

11-
12-
exports.isatty = function(fd) {
11+
function isatty(fd) {
1312
return Number.isInteger(fd) && fd >= 0 && isTTY(fd);
14-
};
13+
}
1514

1615

1716
function ReadStream(fd, options) {
@@ -32,8 +31,6 @@ function ReadStream(fd, options) {
3231
}
3332
inherits(ReadStream, net.Socket);
3433

35-
exports.ReadStream = ReadStream;
36-
3734
ReadStream.prototype.setRawMode = function(flag) {
3835
flag = !!flag;
3936
this._handle.setRawMode(flag);
@@ -64,7 +61,6 @@ function WriteStream(fd) {
6461
}
6562
}
6663
inherits(WriteStream, net.Socket);
67-
exports.WriteStream = WriteStream;
6864

6965

7066
WriteStream.prototype.isTTY = true;
@@ -105,3 +101,6 @@ WriteStream.prototype.clearScreenDown = function() {
105101
WriteStream.prototype.getWindowSize = function() {
106102
return [this.columns, this.rows];
107103
};
104+
105+
106+
module.exports = { isatty, ReadStream, WriteStream };

0 commit comments

Comments
 (0)