Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFeng Yu <F3n67u@outlook.com>2022-06-05 22:56:21 +0300
committerGitHub <noreply@github.com>2022-06-05 22:56:21 +0300
commit797e41c9e567d6e00675639a0b72e330da2e51ae (patch)
tree9560a96ebd43e87134cd975bc369954d0de44576
parentc7c8d8683a2e4a3ced941192e8e41cc5378aa3e1 (diff)
doc: add missing require to stream api doc
PR-URL: https://github.com/nodejs/node/pull/43237 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
-rw-r--r--doc/api/stream.md7
1 files changed, 7 insertions, 0 deletions
diff --git a/doc/api/stream.md b/doc/api/stream.md
index f6e498e7a65..41a98aa827d 100644
--- a/doc/api/stream.md
+++ b/doc/api/stream.md
@@ -1215,6 +1215,7 @@ making it possible to set up chains of piped streams:
```js
const fs = require('node:fs');
+const zlib = require('node:zlib');
const r = fs.createReadStream('file.txt');
const z = zlib.createGzip();
const w = fs.createWriteStream('file.txt.gz');
@@ -2381,6 +2382,7 @@ or has experienced an error or a premature close event.
```js
const { finished } = require('node:stream');
+const fs = require('node:fs');
const rs = fs.createReadStream('archive.tar');
@@ -2403,6 +2405,7 @@ The `finished` API provides promise version:
```js
const { finished } = require('node:stream/promises');
+const fs = require('node:fs');
const rs = fs.createReadStream('archive.tar');
@@ -2501,6 +2504,8 @@ receive an options argument as the last parameter with a
```js
const { pipeline } = require('node:stream/promises');
+const fs = require('node:fs');
+const zlib = require('node:zlib');
async function run() {
await pipeline(
@@ -2519,6 +2524,8 @@ as the last argument:
```js
const { pipeline } = require('node:stream/promises');
+const fs = require('node:fs');
+const zlib = require('node:zlib');
async function run() {
const ac = new AbortController();