text: const fs = require('fs');
  const path = require('path');
  const readline = require('readline');
  const { stdout } = require('process');
  
  const writeStream = fs.createWriteStream(path.join(__dirname, 'text.txt'));
  const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout,
  });
  
  stdout.write('Hi, write something... \n');
  
  rl.on('line', (text) => {
    text !== 'exit' ? writeStream.write(`${text}\n`) : exitApp();
  });
  
  rl.on('SIGINT', () => exitApp());
  
  function exitApp() {
    stdout.write('Have a nice day, Goodbye!');
    rl.close();
  }
  