Computer scienceBackendNode.jsCore ConceptsInternal modulesStreams

Introduction to Streams module

Finish the code

Report a typo

You are given the following piece of code.

const { finished } = require('node:stream/promises');
const fs = require('node:fs');

async function goStream() {
    const myStream = fs.createReadStream('archive.zip');
    await finished(_____);
    console.log('Stream is finished');
}

goStream()
.catch(console.error);

What should you put instead of the blanks to correctly finish the stream?

Enter a short text
___

Create a free account to access the full topic