diff --git a/lib/tty.js b/lib/tty.js index e836beb900f155..08977115c6e60d 100644 --- a/lib/tty.js +++ b/lib/tty.js @@ -6,6 +6,7 @@ const TTY = process.binding('tty_wrap').TTY; const isTTY = process.binding('tty_wrap').isTTY; const inherits = util.inherits; const errnoException = util._errnoException; +const readline = require('readline'); exports.isatty = function(fd) { @@ -90,16 +91,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];