const fs = require('fs');

console.log('Sync');
console.log(fs.readFileSync('test/files/read/file.txt').toString());


const getData = (path) => new Promise((resolve, reject) => {
  fs.readFile(path, { encoding: 'utf-8' }, (err, data) => {
    if (err) reject(err);
    resolve(data);
  })
});

const data = getData('test/files/read/file.txt');

data.then((result) => {
  console.log();
  console.log('Async');
  console.log(result);
})