(function() { var doT = require('../doT.js'), data = { f1: 1, f2: 2, f3: 3}, snippet = '

Just static text

Here is a simple case

Next we will use a JavaScript block:
'; doT.templateSettings = { evaluate : /\<\?([\s\S]+?)\?\>/g, interpolate : /\<\?=([\s\S]+?)\?\>/g, varname : 'it', strip: true }; var doTCompiled = doT.template(snippet); console.log("Generated function: \n" + doTCompiled.toString()); console.log("Result of calling with " + JSON.stringify(data) + " :\n" + doTCompiled(data)); }());