diff options
author | cjihrig <cjihrig@gmail.com> | 2019-07-14 02:22:46 +0300 |
---|---|---|
committer | cjihrig <cjihrig@gmail.com> | 2019-07-16 17:03:13 +0300 |
commit | 795c7482f24c0c2f1b2db8d004b03ea373b6381b (patch) | |
tree | b280986ae8a87411123e3904af4689e5bcf0b6ea /doc/api/readline.md | |
parent | 79cc8bb24117aa40e101971610d5813d927f9fbe (diff) |
readline: expose stream API in moveCursor()
This commit adds an optional callback to moveCursor(), which is
passed to the stream's write() method. It also exposes the
return value of write().
PR-URL: https://github.com/nodejs/node/pull/28674
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Diffstat (limited to 'doc/api/readline.md')
-rw-r--r-- | doc/api/readline.md | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/doc/api/readline.md b/doc/api/readline.md index 936ffb5d842..43314e136fc 100644 --- a/doc/api/readline.md +++ b/doc/api/readline.md @@ -525,14 +525,22 @@ if (process.stdin.isTTY) process.stdin.setRawMode(true); ``` -## readline.moveCursor(stream, dx, dy) +## readline.moveCursor(stream, dx, dy[, callback]) <!-- YAML added: v0.7.7 +changes: + - version: REPLACEME + pr-url: https://github.com/nodejs/node/pull/28674 + description: The stream's write() callback and return value are exposed. --> * `stream` {stream.Writable} * `dx` {number} * `dy` {number} +* `callback` {Function} Invoked once the operation completes. +* Returns: {boolean} `false` if `stream` wishes for the calling code to wait for + the `'drain'` event to be emitted before continuing to write additional data; + otherwise `true`. The `readline.moveCursor()` method moves the cursor *relative* to its current position in a given [TTY][] `stream`. |