Computer scienceBackendNode.jsCore ConceptsInternal modulesStreams

Introduction to Streams module

Pick the missing

Report a typo

Consider the following piece of code:

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

async function main() {
    await ______(
        fs.createReadStream('input.txt'),
        fs.createWriteStream('output.txt')
    );
    console.log('Pipeline succeeded.');
}

main().catch(console.error);

What should you put in the blanks to make this code function correctly?

Select one option from the list
___

Create a free account to access the full topic