Skip to content

Commit 4e3aa9a

Browse files
cjihrigMylesBorins
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 <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
1 parent 4d0c70a commit 4e3aa9a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

‎lib/tty.js‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ const errnoException = util._errnoException;
2929
consterrors=require('internal/errors');
3030
constreadline=require('readline');
3131

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

3636

3737
functionReadStream(fd,options){
@@ -54,8 +54,6 @@ function ReadStream(fd, options){
5454
}
5555
inherits(ReadStream,net.Socket);
5656

57-
exports.ReadStream=ReadStream;
58-
5957
ReadStream.prototype.setRawMode=function(flag){
6058
flag=!!flag;
6159
this._handle.setRawMode(flag);
@@ -90,7 +88,6 @@ function WriteStream(fd){
9088
}
9189
}
9290
inherits(WriteStream,net.Socket);
93-
exports.WriteStream=WriteStream;
9491

9592

9693
WriteStream.prototype.isTTY=true;
@@ -131,3 +128,6 @@ WriteStream.prototype.clearScreenDown = function(){
131128
WriteStream.prototype.getWindowSize=function(){
132129
return[this.columns,this.rows];
133130
};
131+
132+
133+
module.exports={ isatty, ReadStream, WriteStream };

0 commit comments

Comments
(0)