diff --git a/doc/api/stream.md b/doc/api/stream.md index d59cd6b51629e4..5528286a98e60e 100644 --- a/doc/api/stream.md +++ b/doc/api/stream.md @@ -2532,7 +2532,7 @@ const fs = require('fs'); async function run() { await pipeline( fs.createReadStream('lowercase.txt'), - async function* (source, signal) { + async function* (source, { signal }) { source.setEncoding('utf8'); // Work with strings rather than `Buffer`s. for await (const chunk of source) { yield await processChunk(chunk, { signal }); @@ -2556,7 +2556,7 @@ const fs = require('fs'); async function run() { await pipeline( - async function * (signal) { + async function* ({ signal }) { await someLongRunningfn({ signal }); yield 'asd'; },