readline.clearLine(stream, dir[, callback])
stream
<stream.Writable>dir
<number>-1
: 从光标向左1
: 从光标向右0
: 整行
callback
<Function> 操作完成后调用。- 返回: <boolean> 如果
stream
希望调用代码在继续写入额外的数据之前等待'drain'
事件被触发,则为false
;否则为true
。
readline.clearLine()
方法在 dir
标识的指定方向上清除给定 TTY 流的当前行。
stream
<stream.Writable>dir
<number>-1
: to the left from cursor1
: to the right from cursor0
: the entire line
callback
<Function> Invoked once the operation completes.- Returns: <boolean>
false
ifstream
wishes for the calling code to wait for the'drain'
event to be emitted before continuing to write additional data; otherwisetrue
.
The readline.clearLine()
method clears current line of given TTY stream
in a specified direction identified by dir
.