Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 4e3aa9a

Browse filesBrowse 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 <gpunathi@in.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
1 parent 4d0c70a commit 4e3aa9a
Copy full SHA for 4e3aa9a

File tree

Expand file treeCollapse file tree

1 file changed

+5
-5
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+5
-5
lines changed
Open diff view settings
Collapse file

‎lib/tty.js‎

Copy file name to clipboardExpand all lines: lib/tty.js
+5-5Lines changed: 5 additions & 5 deletions
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) {
@@ -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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.