const fs = require('fs');
const path = require('path');

console.log('Start');

const filePath = path.join(__dirname, 'example.html');
if (!fs.existsSync(filePath)) {
    fs.writeFileSync(filePath, '<html><body>Hello World</body></html>', 'utf8');
}

fs.readFile(filePath, 'utf8', (err, data) => {
    console.log('File data read');
    
    if (err) {
        console.log(__dirname);
        console.log(err.message);
        return;
    }
    
    setTimeout(() => {
        console.log('Timeout');
    }, 0);
    
    setImmediate(() => {
        console.log('Immediate');
    });
    
    process.nextTick(() => {
        console.log('Next Tick');
    });
});

console.log('End');