Skip to content

Commit 8ae4e1c

Browse files
committed
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 61793df commit 8ae4e1c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/tty.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ const errnoException = util._errnoException;
2929
const errors = require('internal/errors');
3030
const readline = require('readline');
3131

32-
exports.isatty = function(fd) {
32+
function isatty(fd) {
3333
return Number.isInteger(fd) && fd >= 0 && isTTY(fd);
34-
};
34+
}
3535

3636

3737
function ReadStream(fd, options) {
@@ -60,8 +60,6 @@ function ReadStream(fd, options) {
6060
}
6161
inherits(ReadStream, net.Socket);
6262

63-
exports.ReadStream = ReadStream;
64-
6563
ReadStream.prototype.setRawMode = function(flag) {
6664
flag = !!flag;
6765
this._handle.setRawMode(flag);
@@ -102,7 +100,6 @@ function WriteStream(fd) {
102100
}
103101
}
104102
inherits(WriteStream, net.Socket);
105-
exports.WriteStream = WriteStream;
106103

107104

108105
WriteStream.prototype.isTTY = true;
@@ -143,3 +140,6 @@ WriteStream.prototype.clearScreenDown = function() {
143140
WriteStream.prototype.getWindowSize = function() {
144141
return [this.columns, this.rows];
145142
};
143+
144+
145+
module.exports = { isatty, ReadStream, WriteStream };

0 commit comments

Comments
 (0)