diff options
author | cjihrig <cjihrig@gmail.com> | 2017-11-11 22:58:26 -0500 |
---|---|---|
committer | cjihrig <cjihrig@gmail.com> | 2017-11-14 17:31:26 -0500 |
commit | 8ae4e1cd7b5688b1a719d2104eef0fadfbdcacc9 (patch) | |
tree | 68831b901e0519b7ac0033859ca5657c4b4a5e32 /lib | |
parent | 61793dffe38411a2bbff5229fb9a4b3af771762d (diff) | |
download | node-new-8ae4e1cd7b5688b1a719d2104eef0fadfbdcacc9.tar.gz |
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')
-rw-r--r-- | lib/tty.js | 10 |
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 }; |