summaryrefslogtreecommitdiff
path: root/lib/tty.js
diff options
context:
space:
mode:
authorBryan English <bryan@bryanenglish.com>2017-09-27 23:18:41 -0700
committerRuben Bridgewater <ruben@bridgewater.de>2017-10-01 20:24:01 -0300
commit200e783e6659fca744b23c366d3f95bfebe37dbf (patch)
tree57f31ae69b603eed44d9d52cc543a08209f7e4c5 /lib/tty.js
parent2adf68035c0c8f4106d927568da40baa59ec599a (diff)
downloadandroid-node-v8-200e783e6659fca744b23c366d3f95bfebe37dbf.tar.gz
android-node-v8-200e783e6659fca744b23c366d3f95bfebe37dbf.tar.bz2
android-node-v8-200e783e6659fca744b23c366d3f95bfebe37dbf.zip
tty: require readline at top of file
No need to require it on each of those function calls. PR-URL: https://github.com/nodejs/node/pull/15647 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Diffstat (limited to 'lib/tty.js')
-rw-r--r--lib/tty.js9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/tty.js b/lib/tty.js
index 81647fa684..c0c66a0947 100644
--- a/lib/tty.js
+++ b/lib/tty.js
@@ -28,6 +28,7 @@ const isTTY = process.binding('tty_wrap').isTTY;
const inherits = util.inherits;
const errnoException = util._errnoException;
const errors = require('internal/errors');
+const readline = require('readline');
exports.isatty = function(fd) {
return isTTY(fd);
@@ -117,16 +118,16 @@ WriteStream.prototype._refreshSize = function() {
// backwards-compat
WriteStream.prototype.cursorTo = function(x, y) {
- require('readline').cursorTo(this, x, y);
+ readline.cursorTo(this, x, y);
};
WriteStream.prototype.moveCursor = function(dx, dy) {
- require('readline').moveCursor(this, dx, dy);
+ readline.moveCursor(this, dx, dy);
};
WriteStream.prototype.clearLine = function(dir) {
- require('readline').clearLine(this, dir);
+ readline.clearLine(this, dir);
};
WriteStream.prototype.clearScreenDown = function() {
- require('readline').clearScreenDown(this);
+ readline.clearScreenDown(this);
};
WriteStream.prototype.getWindowSize = function() {
return [this.columns, this.rows];