doc: fix stream iterator helpers examples

PR-URL: https://github.com/nodejs/node/pull/46897
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Debadree Chatterjee <debadree333@gmail.com>
This commit is contained in:
Benjamin Gruenbaum
2023-03-01 18:13:29 +01:00
committed by GitHub
parent e3bb668132
commit 8e4fa26462

View File

@@ -2239,7 +2239,7 @@ const anyBigFile = await Readable.from([
'file3',
]).some(async (fileName) => {
const stats = await stat(fileName);
return stat.size > 1024 * 1024;
return stats.size > 1024 * 1024;
}, { concurrency: 2 });
console.log(anyBigFile); // `true` if any file in the list is bigger than 1MB
console.log('done'); // Stream has finished
@@ -2291,7 +2291,7 @@ const foundBigFile = await Readable.from([
'file3',
]).find(async (fileName) => {
const stats = await stat(fileName);
return stat.size > 1024 * 1024;
return stats.size > 1024 * 1024;
}, { concurrency: 2 });
console.log(foundBigFile); // File name of large file, if any file in the list is bigger than 1MB
console.log('done'); // Stream has finished
@@ -2341,7 +2341,7 @@ const allBigFiles = await Readable.from([
'file3',
]).every(async (fileName) => {
const stats = await stat(fileName);
return stat.size > 1024 * 1024;
return stats.size > 1024 * 1024;
}, { concurrency: 2 });
// `true` if all files in the list are bigger than 1MiB
console.log(allBigFiles);