UNPKG

raptor

Version:

RaptorJS provides an AMD module loader that works in Node, Rhino and the web browser. It also includes various sub-modules to support building optimized web applications.

22 lines 730 B
$rtmpl("simple", function (templating) { var empty = templating.e, notEmpty = templating.ne, forEach = templating.f; return function (data, context) { var write = context.w, rootClass = data.rootClass, colors = data.colors, message = data.message; write('<div class="hello-world ', rootClass, '">', message, '</div>'); if (notEmpty(colors)) { write('<ul>'); forEach(colors, function (color) { write('<li class="color">', color, '</li>'); }); write('</ul>'); } if (empty(colors)) { write('<div>No colors!</div>'); } } });