rl.clearLine(dir)


  • dir <integer>
    • -1: 从光标向左
    • 1: 从光标向右
    • 0: 整行
  • 返回: this

rl.clearLine() 方法在待处理动作的内部列表中添加一个动作,该动作在 dir 标识的指定方向上清除关联 stream 的当前行。 调用 rl.commit() 看看这个方法的效果,除非 autoCommit: true 传给了构造函数。

  • dir <integer>
    • -1: to the left from cursor
    • 1: to the right from cursor
    • 0: the entire line
  • Returns: this

The rl.clearLine() method adds to the internal list of pending action an action that clears current line of the associated stream in a specified direction identified by dir. Call rl.commit() to see the effect of this method, unless autoCommit: true was passed to the constructor.