Skip to content

Commit d0b1fb3

Browse files
imcottontargos
authored andcommitted
doc: api/stream.md typo from writeable to writable
PR-URL: #28822 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: Richard Lau <[email protected]>
1 parent 2262526 commit d0b1fb3

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

doc/api/stream.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2504,23 +2504,23 @@ readable.on('data', (chunk) => {
25042504

25052505
#### Piping to Writable Streams from Async Iterators
25062506

2507-
In the scenario of writing to a writeable stream from an async iterator,
2507+
In the scenario of writing to a writable stream from an async iterator,
25082508
it is important to ensure the correct handling of backpressure and errors.
25092509

25102510
```js
25112511
const { once } = require('events');
25122512

2513-
const writeable = fs.createWriteStream('./file');
2513+
const writable = fs.createWriteStream('./file');
25142514

25152515
(async function() {
25162516
for await (const chunk of iterator) {
25172517
// Handle backpressure on write().
2518-
if (!writeable.write(chunk))
2519-
await once(writeable, 'drain');
2518+
if (!writable.write(chunk))
2519+
await once(writable, 'drain');
25202520
}
2521-
writeable.end();
2521+
writable.end();
25222522
// Ensure completion without errors.
2523-
await once(writeable, 'finish');
2523+
await once(writable, 'finish');
25242524
})();
25252525
```
25262526

@@ -2533,13 +2533,13 @@ then piped via `.pipe()`:
25332533
```js
25342534
const { once } = require('events');
25352535

2536-
const writeable = fs.createWriteStream('./file');
2536+
const writable = fs.createWriteStream('./file');
25372537

25382538
(async function() {
25392539
const readable = Readable.from(iterator);
2540-
readable.pipe(writeable);
2540+
readable.pipe(writable);
25412541
// Ensure completion without errors.
2542-
await once(writeable, 'finish');
2542+
await once(writable, 'finish');
25432543
})();
25442544
```
25452545

0 commit comments

Comments
 (0)