Proper way to reference files relative to application root in Node.JS August 6, 2023 by Tarik Try var templateContent = fs.readFileSync(path.join(__dirname, '../templates') + '/my-template.html', 'utf8');