doT
The fastest + concise javascript template engine for nodejs
...It took me years to grasp how it works even though it’s only 140 lines of code, it looks like magic. I used it in my other projects (e.g. ajv) as the smallest, fastest and most functional (all three!) templating engine ever made, that is particularly useful in all code generation scenarios where manipulating AST is overkill. doT allows arbitrary JavaScript code in templates, making it one of the most flexible and powerful templating engines.