Pattern Library Utilities

twigCompiler

method
exports.twigCompiler()

@param Type Description
twigOptions Object twig configuration options
twigOptions.path Object source file to be compiled
data Object object of template-matching data

Compiles twig templates into html

exports.twigCompiler = function (twigOptions, data) {
  'use strict';
  var tpl = twig.twig(twigOptions); // read the file with Twig
  return tpl.render(data);
};