Files
pdfer/templates.js
Thomas Ruoff d806327bf9 make pdfs
2017-02-16 00:47:52 +01:00

14 lines
350 B
JavaScript

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!`);
}
};