Add some code in the indicated places, which will allow you to read the file and print the second word in the file in the string data type (not a buffer!) to the console. Perhaps the split method for strings will help you highlight the first word.
Introduction to fs module
Self-reading
Report a typo
Write a program in JavaScript
const fs = require('fs'); //do not change this line
const data = fs.readFile('main.js', /* your code */, (err, data) => {
/* your code */
});
___
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.