GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — doc: rename iterator to iterable in examples · nodejs/node@0e48d8d

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • doc/api
    • stream.md
Expand file treeCollapse file tree
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)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.