mirror of
https://github.com/tomru/pdfer.git
synced 2026-03-03 14:37:21 +01:00
14 lines
350 B
JavaScript
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!`);
|
|
}
|
|
};
|