text: import fs from 'fs';
  import readline from 'readline';
  fs.writeFile('./02-write-file/helloworld.txt', '', function (err) {
    if (err) return console.log(err);
  });
  
  const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout
  });
  
  rl.question('Hi, please, enter the text: ', function(input) {
      fs.appendFile('./02-write-file/helloworld.txt', `${input}`, (err) => {
        input == 'exit' ? rl.close() : null
        if (err) {
          console.log(err);
        }
      });
  });
  
  rl.on('line', (input) => {
    fs.appendFile('./02-write-file/helloworld.txt', `\n${input}`, (err) => {
      input == 'exit' ? rl.close() : null
      if (err) {
        console.log(err);
      }
    });
  });
  
  rl.on('close', function() {
    console.log('BYE BYE !!!');
    process.exit(0);
  });
  