Skip to content

Commit f8ff7c7

Browse files
committed
fixup! readline: add support for async iteration
Documentation changes
1 parent 179dd7b commit f8ff7c7

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

doc/api/readline.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,12 +322,17 @@ Create an `AsyncIterator` object that iterates through each line in the input
322322
stream as a string. This method allows asynchronous iteration of
323323
`readline.Interface` objects through `for`-`await`-`of` loops.
324324

325-
*Note:* Errors in the input stream are not forwarded.
325+
Errors in the input stream are not forwarded.
326326

327327
If the loop is terminated with `break`, `throw`, or `return`,
328328
[`rl.close()`][] will be called. In other words, iterating over a
329329
`readline.Interface` will always consume the input stream fully.
330330

331+
A caveat with using this experimental API is that the performance is
332+
currently not on par with the traditional `'line'` event API, and thus it is
333+
not recommended for performance-sensitive applications. We expect this
334+
situation to improve in the future.
335+
331336
```js
332337
async function processLineByLine() {
333338
const rl = readline.createInterface({

0 commit comments

Comments
 (0)