Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 0e48d8d

Browse filesBrowse files
ronagMylesBorins
authored andcommitted
doc: rename iterator to iterable in examples
PR-URL: #31252 Fixes: #31222 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent d51de78 commit 0e48d8d
Copy full SHA for 0e48d8d

File tree

Expand file treeCollapse file tree

1 file changed

+5
-5
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+5
-5
lines changed
Open diff view settings
Collapse file

‎doc/api/stream.md‎

Copy file name to clipboardExpand all lines: doc/api/stream.md
+5-5Lines changed: 5 additions & 5 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -2644,8 +2644,8 @@ const finished = util.promisify(stream.finished);
26442644

26452645
const writable = fs.createWriteStream('./file');
26462646

2647-
async function pump(iterator, writable) {
2648-
for await (const chunk of iterator) {
2647+
async function pump(iterable, writable) {
2648+
for await (const chunk of iterable) {
26492649
// Handle backpressure on write().
26502650
if (!writable.write(chunk)) {
26512651
if (writable.destroyed) return;
@@ -2658,7 +2658,7 @@ async function pump(iterator, writable) {
26582658
(async function() {
26592659
// Ensure completion without errors.
26602660
await Promise.all([
2661-
pump(iterator, writable),
2661+
pump(iterable, writable),
26622662
finished(writable)
26632663
]);
26642664
})();
@@ -2682,7 +2682,7 @@ const finished = util.promisify(stream.finished);
26822682
const writable = fs.createWriteStream('./file');
26832683

26842684
(async function() {
2685-
const readable = Readable.from(iterator);
2685+
const readable = Readable.from(iterable);
26862686
readable.pipe(writable);
26872687
// Ensure completion without errors.
26882688
await finished(writable);
@@ -2697,7 +2697,7 @@ const pipeline = util.promisify(stream.pipeline);
26972697
const writable = fs.createWriteStream('./file');
26982698

26992699
(async function() {
2700-
const readable = Readable.from(iterator);
2700+
const readable = Readable.from(iterable);
27012701
await pipeline(readable, writable);
27022702
})();
27032703
```

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.