diff options
author | cjihrig <cjihrig@gmail.com> | 2019-07-11 19:35:34 +0300 |
---|---|---|
committer | cjihrig <cjihrig@gmail.com> | 2019-07-13 23:20:06 +0300 |
commit | c31f7e595af85da8ada5d278e6e96e8537b57435 (patch) | |
tree | 50195329340d2e972502846500f6425c53c7ab05 /doc/api/readline.md | |
parent | a013aa0f5eba9915e2c996e32281433f72d495ae (diff) |
readline: expose stream API in clearScreenDown()
This commit adds an optional callback to clearScreenDown(),
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/28641
Reviewed-By: Michaƫl Zasso <targos@protonmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
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 8f372a8473e..b295ace5b3f 100644 --- a/doc/api/readline.md +++ b/doc/api/readline.md @@ -360,12 +360,20 @@ added: v0.7.7 The `readline.clearLine()` method clears current line of given [TTY][] stream in a specified direction identified by `dir`. -## readline.clearScreenDown(stream) +## readline.clearScreenDown(stream[, callback]) <!-- YAML added: v0.7.7 +changes: + - version: REPLACEME + pr-url: https://github.com/nodejs/node/pull/28641 + description: The stream's write() callback and return value are exposed. --> * `stream` {stream.Writable} +* `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.clearScreenDown()` method clears the given [TTY][] stream from the current position of the cursor down. |