mangony-hbs-helpers
Version:
Handlebars helpers used by Mangony
20 lines (18 loc) • 382 B
JavaScript
/**
* Represents a helper to embed files.
*
* @author Sebastian Fitzner
*/
const fs = require('fs');
module.exports = embeding;
module.exports.register = function (Handlebars) {
Handlebars.registerHelper('embeding', embeding);
};
/**
* Embed file from a path.
*
* @param {String} path - Path to file
*/
function embeding(path) {
return fs.readFileSync(path, 'utf-8');
}