summaryrefslogtreecommitdiff
path: root/lib/tty.js
diff options
context:
space:
mode:
authorcjihrig <cjihrig@gmail.com>2017-11-11 22:58:26 -0500
committercjihrig <cjihrig@gmail.com>2017-11-14 17:31:26 -0500
commit8ae4e1cd7b5688b1a719d2104eef0fadfbdcacc9 (patch)
tree68831b901e0519b7ac0033859ca5657c4b4a5e32 /lib/tty.js
parent61793dffe38411a2bbff5229fb9a4b3af771762d (diff)
downloadandroid-node-v8-8ae4e1cd7b5688b1a719d2104eef0fadfbdcacc9.tar.gz
android-node-v8-8ae4e1cd7b5688b1a719d2104eef0fadfbdcacc9.tar.bz2
android-node-v8-8ae4e1cd7b5688b1a719d2104eef0fadfbdcacc9.zip
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: https://github.com/nodejs/node/pull/16959 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Diffstat (limited to 'lib/tty.js')
-rw-r--r--lib/tty.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/tty.js b/lib/tty.js
index 144fc86b8e..2a62fcb859 100644
--- a/lib/tty.js
+++ b/lib/tty.js
@@ -29,9 +29,9 @@ const errnoException = util._errnoException;
const errors = require('internal/errors');
const readline = require('readline');
-exports.isatty = function(fd) {
+function isatty(fd) {
return Number.isInteger(fd) && fd >= 0 && isTTY(fd);
-};
+}
function ReadStream(fd, options) {
@@ -60,8 +60,6 @@ function ReadStream(fd, options) {
}
inherits(ReadStream, net.Socket);
-exports.ReadStream = ReadStream;
-
ReadStream.prototype.setRawMode = function(flag) {
flag = !!flag;
this._handle.setRawMode(flag);
@@ -102,7 +100,6 @@ function WriteStream(fd) {
}
}
inherits(WriteStream, net.Socket);
-exports.WriteStream = WriteStream;
WriteStream.prototype.isTTY = true;
@@ -143,3 +140,6 @@ WriteStream.prototype.clearScreenDown = function() {
WriteStream.prototype.getWindowSize = function() {
return [this.columns, this.rows];
};
+
+
+module.exports = { isatty, ReadStream, WriteStream };