diff options
author | cjihrig <cjihrig@gmail.com> | 2019-06-27 20:49:58 +0300 |
---|---|---|
committer | cjihrig <cjihrig@gmail.com> | 2019-06-27 20:52:17 +0300 |
commit | 6045fbbb5ee970809c92569e201895ef6345ed48 (patch) | |
tree | 08ee82bd7e7eb21e069277efb8902d1388499c57 /doc/api/readline.md | |
parent | d22fbbe94246d5363ea17c29d8cd5c3b9ca8125b (diff) |
doc: reformat for-await-of
Instead of `for`-`await`-`of`, prefer `for await...of`.
PR-URL: https://github.com/nodejs/node/pull/28425
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Diffstat (limited to 'doc/api/readline.md')
-rw-r--r-- | doc/api/readline.md | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/doc/api/readline.md b/doc/api/readline.md index 1e1861c1ab6..8f372a8473e 100644 --- a/doc/api/readline.md +++ b/doc/api/readline.md @@ -322,7 +322,7 @@ changes: Create an `AsyncIterator` object that iterates through each line in the input stream as a string. This method allows asynchronous iteration of -`readline.Interface` objects through `for`-`await`-`of` loops. +`readline.Interface` objects through `for await...of` loops. Errors in the input stream are not forwarded. @@ -556,7 +556,7 @@ rl.on('line', (line) => { A common use case for `readline` is to consume an input file one line at a time. The easiest way to do so is leveraging the [`fs.ReadStream`][] API as -well as a `for`-`await`-`of` loop: +well as a `for await...of` loop: ```js const fs = require('fs'); @@ -597,7 +597,7 @@ rl.on('line', (line) => { }); ``` -Currently, `for`-`await`-`of` loop can be a bit slower. If `async` / `await` +Currently, `for await...of` loop can be a bit slower. If `async` / `await` flow and speed are both essential, a mixed approach can be applied: ```js |