UNPKG

498 BJavaScriptView Raw
1"use strict";
2var handlebars = require("handlebars");
3var fs = require("fs");
4exports.loadFromPath = function (filePath) {
5 if (fs.existsSync(filePath)) {
6 return fs.readFileSync(filePath, 'utf8');
7 }
8 else {
9 throw new Error("Template file " + filePath + " does not exists!");
10 }
11};
12exports.generateCode = function (compileContext, templatePath) {
13 return handlebars.compile(exports.loadFromPath(templatePath))(compileContext);
14};
15//# sourceMappingURL=generator.js.map
\No newline at end of file