Computer scienceBackendNode.jsCore ConceptsInternal modulesStreams

What are streams?

Open, print, close

Report a typo

You need to compose a program by arranging lines of code. Arrange event handlers in the order in which the corresponding events are emitted.

Reorder lines using drag or arrows. Adjust indentation with left buttons
                readerStream.on('close', () => console.log("It's closed!"));
              
                readerStream.on('data', (chunk) => { console.log( chunk ) });
              
                const fs = require("node:fs");
              
                readerStream.on('open', () => { console.log("It's opened!") });
              
                const readerStream = fs.createReadStream('./data.txt');
              
___

Create a free account to access the full topic