Skip to content

Commit c3cc30e

Browse files
F3n67utargos
authored andcommitted
doc: add missing require to stream api doc
PR-URL: #43237 Reviewed-By: Antoine du Hamel <[email protected]>
1 parent 0289f02 commit c3cc30e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

doc/api/stream.md

+7
Original file line numberDiff line numberDiff line change
@@ -1182,6 +1182,7 @@ making it possible to set up chains of piped streams:
11821182

11831183
```js
11841184
const fs = require('node:fs');
1185+
const zlib = require('node:zlib');
11851186
const r = fs.createReadStream('file.txt');
11861187
const z = zlib.createGzip();
11871188
const w = fs.createWriteStream('file.txt.gz');
@@ -2316,6 +2317,7 @@ or has experienced an error or a premature close event.
23162317

23172318
```js
23182319
const { finished } = require('node:stream');
2320+
const fs = require('node:fs');
23192321

23202322
const rs = fs.createReadStream('archive.tar');
23212323

@@ -2338,6 +2340,7 @@ The `finished` API provides promise version:
23382340

23392341
```js
23402342
const { finished } = require('node:stream/promises');
2343+
const fs = require('node:fs');
23412344

23422345
const rs = fs.createReadStream('archive.tar');
23432346

@@ -2431,6 +2434,8 @@ receive an options argument as the last parameter with a
24312434

24322435
```js
24332436
const { pipeline } = require('node:stream/promises');
2437+
const fs = require('node:fs');
2438+
const zlib = require('node:zlib');
24342439

24352440
async function run() {
24362441
await pipeline(
@@ -2449,6 +2454,8 @@ as the last argument:
24492454

24502455
```js
24512456
const { pipeline } = require('node:stream/promises');
2457+
const fs = require('node:fs');
2458+
const zlib = require('node:zlib');
24522459

24532460
async function run() {
24542461
const ac = new AbortController();

0 commit comments

Comments
 (0)