a very lightweight (and spoooooky) templating tool (that is also your boo โค๏ธ)
var template = new BooTemplate("This is {{foo}}ey.");
template.compile({foo: "barn"});
// => "This is barney."
var template = new BooTemplate("This is <%foo%>ey.", "<%", "%>");
template.compile({foo: "barkl"});
// => "This is barkley."
the Compiler is what powers a template. It implements a global search on a given template string and evalutes anything between open
and close
delimiters.
open
and close
default to "{{"
and "}}"
var compiler = new BooTemplate.Compiler();
compiler.compile("{{foo}}{{bar}}", {foo: "Boo", bar: "Template"});
// => "BooTemplate"
var compiler = new BooTemplate.Compiler("<%", "%>");
compiler.compile("<%foo%> <%bar%>", {foo: "Your", bar: "Boo"});
// => "Your Boo"