const path = require('path'); module.exports.get = (templateName, options, callback) => { const modulePath = path.join(__dirname, 'templates', templateName); let template; try { template = require(modulePath); callback(null, template(options)); } catch (e) { callback(`${templateName} not found!`); } };