You need to compose a program by arranging lines of code. Arrange event handlers in the order in which the corresponding events are emitted.
What are streams?
Open, print, close
Report a typo
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');
___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.